0
votes

I have this simple table:

CREATE TABLE foo
(
 storeName varchar(50),
 keyName varchar(50),
 docname varchar(512),
 config clob,
 CONSTRAINT foo_pk PRIMARY KEY(storeName, keyName)
)

And this select statement:

SELECT config ,docname
FROM foo 
WHERE storeName = 'SolutionFramework' 
AND keyName = 'Solutions'

And this is the error I get: (42000/904) ORA-00904: "KEYNAME": invalid identifier

Can anyone help me with this?

2
This is working on SQL Fiddle. What version of Oracle? - Taryn
Are you sure you created the column as keyName and not as "keyName"? The latter preserves case in the name and forces you to refer to it in a case-sensitive manner, i.e. as "keyName". - Klas Lindbäck
and here is a sqlfiddle demo for @KlasLindbäck suggestion sqlfiddle.com/#!4/0cb76/1 - A.B.Cade

2 Answers

0
votes

Remove quotes around keyName in CREATE TABLE command.

0
votes

Identifiers are nothing but a name that is given to oracle object. The object could be constant, variable, exception, cursors, procedures, function, package, trigger, object type, reserve word or label. Make sure you have used the same column name.