If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Error with DB2 reserved words in SQL?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-31-09, 23:10
tataforums tataforums is offline
Registered User
 
Join Date: Feb 2009
Posts: 9
Question Error with DB2 reserved words in SQL?

Hi All,

In some of our programs DB2 reserved words are being used.

DAY and PARAMETER are two columns in a table.

in one program we inserted DAY - with out any delimeters like insert into table(day) values(day) - it is not giving any error.

in other program we are insering parameter in the same way inser into table(parameter) values(parameter) - it is giving compilation error saying "parameter" is a reserved word..

if I modify the statement as insert into table("parameter") values (parameter) -- delimeted the column name - it is working fine.

Could you please advice why it is happening some times?

is there any special way to bind if we are using reserved words?
Reply With Quote
  #2 (permalink)  
Old 06-01-09, 00:57
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
Please give exact and complete error message(s).
And, where did day and parameter in values(day) and values(parameter) came from?
Reply With Quote
  #3 (permalink)  
Old 06-01-09, 04:00
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Also note that this may depend on your specific platform and version of DB2.
Personally I've never had any "reserved word" conflicts with DB2 for z/OS.
But the precompiler sometimes thinks he's clever and flags some "valid" constructs (e.g. because they contain reserved words).
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On