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 > Sequence as column name in DB2 V8 on MVS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-27-07, 16:28
shelkesanty shelkesanty is offline
Registered User
 
Join Date: Sep 2007
Posts: 1
Sequence as column name in DB2 V8 on MVS

I am running my application on Windows.
Developed in C++.

The DB2 V8 database is installed on MVS mainframes.

Currently i am getting error as follows :
************************************************** ***************************
Insert into SANS.log(sequence,subsequence,recordTypt,logDate,n ame,action) values (:sequene, :subsequence, :recordType, :logDate, :name, :action)

Class: DBMS
Native Error Code: -199

[IBM][CLI Driver][DB2]SQL0199N The use of the reserved word "SEQUENCE" following "" is not valid. Expected Tokens may include "( SELECT"/ SQLSTATE=42601
************************************************** ***************************

please update me regarding this issue....

thanks.
Reply With Quote
  #2 (permalink)  
Old 09-27-07, 17:37
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by shelkesanty
please update me regarding this issue....
Code:
update you set advice='Read the error message' where regarding='this issue'
Seriously though, try quoting the offending column name:
Code:
Insert into SANS.log("SEQUENCE", ...
Note the uppercase: if you quote an object name it becomes case sensitive.
Reply With Quote
  #3 (permalink)  
Old 09-29-07, 12:58
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Alternatively: move to V9 (if possible). The V9 SQL parser is more case-sensitive and detects that you are specifying columns names there and allows reserved words.

Btw, this would be syntactically correct SQL but not all DBMS can parse this successfully:
Code:
SELECT SELECT SELECT, FROM FROM
FROM   FROM FROM
WHERE  WHERE = WHERE
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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