Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2007
    Posts
    1

    Unanswered: 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.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •