Problems with underscore column names quering

Tags:
SQL
Hi I am having problems working with the PL/SQL, the thing is that I installed the oracle db 10g software wich i downloaded from the Oracle Site, now i am testing some queries, I have a table called GRP_GROUPS wich has some fields like ID, and GRP_Name, when i try to do a select like this: SELECT GRP_Name FROM GRP_GROUPS the result is an error that says that GRP_Name is not valid identifier, only if i go like SELECT "GRP_Name" FROM GRP_GROUPS will it work, how can make this work without the " character?
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

You defined your column name with double quotes around it, so Oracle cannot recognize GRP_Name in the query as the column name (it converts all unquoted names to uppercase during data definition and during query interpretation). The column name is stored in upper and lower case if you define it enclosed in double quotes, but it is stored in uppercase (and can be referenced in any combination of upper and lower case characters) if you do not, i.e., GRP_Name, grp_name, GRP_NAME, gRp_nAmE are all equivalent if not double quoted. Either go back and redefine your table(s)and columns without using double quotes or remember to double quote enclose all names in your queries.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: