Fixes are available
DB2 Version 9.5 Fix Pack 3b for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 2a for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 2 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 3a for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 3 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 4a for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 5 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 6a for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.5 Fix Pack 10 for Linux, UNIX, and Windows
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:
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
Document Information
Modified date:
15 October 2021