Oracle table column names starting with a number

0 pts.
Tags:
Oracle
PL/SQL
Query
Hello, I just finished creating MANY tables that have column names starting with a number. I didn’t realize it was an issue until I started trying to select data from my tables using the column names in the where clause. Inserts work. Selects without where work. Is there any way to keep the column names or will I have to change them all to be able to limit a select? SQL> select * from tbl5bis where 5bis_id = 1; select * from tbl5bis where 5bis_id = 1 * ERROR at line 1: ORA-00920: invalid relational operator The way I named the columns makes the most sense for the data they are holding . . . I would like to keep the column names if possible but obviously I have to be able to use the where clause. Thanks, Jaime
ASKED: November 2, 2007  12:56 AM
UPDATED: November 7, 2007  5:36 PM

Answer Wiki

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

Try using a quoted identifier.
select * from tbl5bis where “5bis_id ” = 1;

Discuss This Question: 1  Reply

 
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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Jaime
    Thank you, this worked, but now I am having an issue using the column names in the select statement. It doesn't like the quotes around the column names and I need to do an update to the row. update tbl5bis set "5bis_01" = 'info'; I have also tried doing update tbl5bis set tbl5bis.5bis_01 = 'info'; It didn't like that either . . . Any suggestions would be greatly appreciated. Jaime
    0 pointsBadges:
    report

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following