|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem Inserting a reserved key word into Database |
« View previous topic :: View next topic » |
Author |
Message
|
busy_chap |
Posted: Mon Sep 10, 2007 8:00 am Post subject: Problem Inserting a reserved key word into Database |
|
|
Acolyte
Joined: 18 May 2006 Posts: 69
|
Hello all,
I have posted this problem earlier . I wanted to find the same thread but couldn't find it when I searched. So trying to post as a new topic.
My problem is that, I am trying to insert few values though my WBI code into a database and out of them few column names are reserved key words in the database.
For example:
INSERT INTO Database.Oracle123.ORA_IMPORT
(AR,AS,BX,BY)
Values(1,2,3,4);
AR and BS would get inserted without any problem if I comment out AS and BY . Since AS and BY are key words in the database my code is unable to insert the values and the error that I get is Inavlid column
description.
I have even tried :
INSERT INTO Database.Oracle123.ORA_IMPORT
(AR,'AS',BX,'BY')
Values(1,2,3,4);
But no use. I have even used passthrough but nothing fruitful.
Can anybody suggest me any ideas?
Thanks in advance. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Sep 10, 2007 11:02 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need to use double-quotes, not single-quotes for this kind of thing.
Double-quotes means "This is a reserved word or a string with funny characters, that I want to use as an identifier".
Single-quotes means 'This is a scalar value'.
You might also consider asking your DBAs to give your columns meaningful names, rather than two-character mnemonics. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
busy_chap |
Posted: Mon Sep 10, 2007 12:12 pm Post subject: |
|
|
Acolyte
Joined: 18 May 2006 Posts: 69
|
Hi Jeff,
Thanks for your suggestion. I have tried double quotes too and I get the same error
[Oracle]ORA-01747: invalid user.table.column, table.column, or column specification
I have already talked to the database guys and the only way this will work is to change the column names which is strictly opposed by Application as these names are linked to several other components from the application perspective.
Is there any other way out? |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Sep 10, 2007 12:23 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Here is your previous thread:
http://www.mqseries.net/phpBB2/viewtopic.php?p=185147
I think you need to use passthru, and put the keywords in whatever kind of quotes that Oracle needs, inside the single-quotes around the whole statement.
And while I understand that the existing application is designed around these really bad column names... it should be clear to every there that these are really bad column names. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|