Insert into Oracle with reserved word

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
bicap
Premium Member
Premium Member
Posts: 95
Joined: Mon May 03, 2010 10:22 pm
Location: India
Contact:

Insert into Oracle with reserved word

Post by bicap »

Hello,

I am using Oracle connector stage my insert statement have reserved word column DEFAULT..when I run my job it gives me error
ORA-01747: invalid user.table.column, table.column, or column specification

when I put "DEFAULT" in double quotes it gives me error ORA-01745: invalid host/bind variable name.

Do we have any other alternative apart from changing the name of column.

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Let me chime in with, even if you can work around it, having a table with a column name that is a reserved word falls firmly in the Not A Good Idea camp. IMHO. Have you verified that is indeed the problem? If the column is nullable, don't include it in the DML and then see if it works... as a test.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

If you use generated code then add a quote character to properties then it will get the correct quote character. I am not sure what Oracle's quote character is but it appears not to be a double quote otherwise this would work.

Most databases work this same way. Keywords can be column names if quoted correctly.

I totally agree with Craig. This is never a good idea to have a column name the same name as a keyword but normally you can make it work. They had to quote it this way to create the table.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Oracle uses a double-quote as shown, guessing it confused the bind variable mechanism in the connector.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply