IBM Support

LI73731: DB2look generated SQL code gives error SQL0206N, when SQL Comment '--' is used and lines 70+ charaters long

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Execution of SQL code generated by DB2look can gives error
    
    SQL0206N when the SQL Code used to create the object contains
    SQL Comment '--', and the SQL code's line is 70+ characters
    long.
    
    -- Create the TABLE
    
    CREATE SCHEMA T1CORE;
    
    SET SCHEMA T1CORE;
    
    CREATE TABLE T1 (C1_LONG_COLUMN_NAME INT,
       C2_LONG_COLUMN_NAME INT,
                     C3_LONG_COLUMN_NAME INT
                   );
    
    INSERT INTO T1 VALUES(1,10, 100), (2,20,200), (3,30,300) ;
    
    -- Create the VIEW
    
    SET SCHEMA T1CORE;
    
    CREATE VIEW FOO AS
    SELECT C1_LONG_COLUMN_NAME, -- , LONG_COLUMN_COMMENT
    LONG_COLUMN_TEXT
               C2_LONG_COLUMN_NAME
               ,C3_LONG_COLUMN_NAME
          FROM T1;
    
    
    Then generate the view's SQL with db2look:
    
    db2look -d db49810 -e -o db2look_foo.out -z T1CORE -v foo
    
    The SQL generated gives error:
    
    SQL0206N  "LONG_COLUMN_TEXT" is not valid in the context where
    it is used.
    
    SQLSTATE=42703
    

Local fix

  • Use other type of Comment like C Comment /* text */ or
    CLP Commnet or COMMENT ON
    

Problem summary

  • Execution of SQL code generated by DB2look can gives error
    
    SQL0206N when the SQL Code used to create the object contains
    SQL Comment '--', and the SQL code's line is 70+ characters
    long.
    
    -- Create the TABLE
    
    CREATE SCHEMA T1CORE;
    
    SET SCHEMA T1CORE;
    
    CREATE TABLE T1 (C1_LONG_COLUMN_NAME INT,
       C2_LONG_COLUMN_NAME INT,
                     C3_LONG_COLUMN_NAME INT
                   );
    
    INSERT INTO T1 VALUES(1,10, 100), (2,20,200), (3,30,300) ;
    
    -- Create the VIEW
    
    SET SCHEMA T1CORE;
    
    CREATE VIEW FOO AS
    SELECT C1_LONG_COLUMN_NAME, -- , LONG_COLUMN_COMMENT
    LONG_COLUMN_TEXT
               C2_LONG_COLUMN_NAME
               ,C3_LONG_COLUMN_NAME
          FROM T1;
    
    
    Then generate the view's SQL with db2look:
    
    db2look -d db49810 -e -o db2look_foo.out -z T1CORE -v foo
    
    The SQL generated gives error:
    
    SQL0206N  "LONG_COLUMN_TEXT" is not valid in the context where
    it is used.
    
    SQLSTATE=42703
    

Problem conclusion

  • The APAR has been shipped in a fixpak. Sysrout Of: LI73163
    

Temporary fix

  • Use other type of Comment like C Comment /* text */ or
    CLP Commnet or COMMENT ON
    

Comments

APAR Information

  • APAR number

    LI73731

  • Reported component name

    DB2 UDE ESE LIN

  • Reported component ID

    5765F4104

  • Reported release

    950

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2008-08-13

  • Closed date

    2008-08-27

  • Last modified date

    2008-11-05

  • APAR is sysrouted FROM one or more of the following:

    LI73163

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 UDE ESE LIN

  • Fixed component ID

    5765F4104

Applicable component levels

  • R950 PSY

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"950","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
05 November 2008