DB2 - Problembeschreibung
Problem IC76686 | Status: Geschlossen |
ALTER PROCEDURE statement doesn't keep LF at the end of each line as CREATE PROCEDURE statement when sent to server via CLP. | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problembeschreibung: | |
The DDL of ALTER PROCEDURE statement is sent to server in single line if -- style of comment is not used. It is against the behavior of CREATE PROCEDURE which keeps all LFs and DDL are in multiple lines as given to CLP. So, CLP should add Line Feed (0x0A) at the end of each line for the ALTER PROCEDURE statement so that the behavior is consistent with CREATE PROCEDURE command. The linefeed will preserve any new lines used in the ALTER PROCEDURE statement so that when the DDL is produced for an ALTER PROCEDURE statement, its output will not be in a single line. At present, when we write following alter procedure command in a CLP script and execute it using "db2 -td@ -vf filename" : alter procedure majason.sp1 replace version v1 () DISABLE DEBUG MODE ISOLATION LEVEL CS LANGUAGE SQL P1: BEGIN -- Test Insert INSERT INTO T1 VALUES( /* need to find why this multiline comment fails */ -- here it should work. 11, -- see what happens here. 55); /* if there is a ' or " in th */ END P1@ The output at present comes as below in single line. Yes, there is an LF at the end of -- style comment. alter procedure majason.sp1 replace version v1 () DISABLE DEBUG MODE ISOLATION LEVEL CS LANGUAGE SQL P1: BEGIN INSERT INTO T1 VALUES( /* need to find why this multiline comment fails */ 11, -- see what happens here. 55); /* if there is a ' or " in th */ END P1 DB20000I The SQL command completed successfully. The above output should come as below: alter procedure majason.sp1 replace version v1 () DISABLE DEBUG MODE ISOLATION LEVEL CS LANGUAGE SQL P1: BEGIN -- Test Insert INSERT INTO T1 VALUES( /* need to find why this multiline comment fails */ -- here it should work. 11, -- see what happens here. 55); /* if there is a ' or " in th */ END P1 DB20000I The SQL command completed successfully. | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * The DDL of ALTER PROCEDURE statement is sent to server in * * single * * line if -- style of comment is not used. It is against the * * * * behavior of CREATE PROCEDURE which keeps all LFs and DDL are * * in * * multiple lines as given to CLP. * * * * * * * * So, CLP should add Line Feed (0x0A) at the end of each line * * for * * the ALTER PROCEDURE statement so that the behavior is * * consistent * * with CREATE PROCEDURE command. The linefeed will preserve * * any * * new lines used in the ALTER PROCEDURE statement so that when * * the * * DDL is produced for an ALTER PROCEDURE statement, its * * output * * will not be in a single line. * * * * * * * * At present, when we write following alter procedure command * * in a * * CLP script and execute it using "db2 -td@ -vf filename" : * * * * * * * * alter procedure majason.sp1 replace version v1 () * * * * DISABLE DEBUG MODE * * * * ISOLATION LEVEL CS * * * * LANGUAGE SQL * * * * P1: BEGIN * * * * -- Test Insert * * * * INSERT INTO T1 VALUES( /* need to find why * * * * this multiline comment fails * * */ * * -- here it should work. * * * * 11, -- see what happens here. * * * * 55); /* if there is a ' or " in th */ * * * * END P1@ * * * * * * * * * * * * The output at present comes as below in single line. Yes, * * there * * is an LF at the end of -- style comment. * * * * * * * * alter procedure majason.sp1 replace version v1 () DISABLE * * DEBUG MODE ISOLATION LEVEL CS LANGUAGE SQL P1: BEGIN INSERT * * INTO T1 VALUES( /* need to find why this multiline comment * * fails */ 11, -- see what happens here. * * 55); /* if there is a ' or " in th */ END P1 * * DB20000I The SQL command completed successfully. * * * * * * The above output should come as below: * * * * * * * * alter procedure majason.sp1 replace version v1 () * * * * DISABLE DEBUG MODE * * * * ISOLATION LEVEL CS * * * * LANGUAGE SQL * * * * P1: BEGIN * * * * -- Test Insert * * * * INSERT INTO T1 VALUES( /* need to find why * * * * this multiline comment fails * * */ * * -- here it should work. * * * * 11, -- see what happens here. * * * * 55); /* if there is a ' or " in th */ * * * * END P1 * * * * DB20000I The SQL command completed successfully. * **************************************************************** * RECOMMENDATION: * * Apply v9.7 Fixpack 5. * **************************************************************** | |
Local-Fix: | |
Use old style comments ( -- ) at the end of each line, which keeps LF at the end. The format of old style comment is -- <some text> \n | |
verfügbare FixPacks: | |
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows | |
Lösung | |
Problem was first fixed in v9.7 Fixpack 5. This fix should be applied to the system where the DB2 CLP is being executed. | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 30.05.2011 02.01.2012 02.01.2012 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.7.FP5 | |
Problem behoben lt. FixList in der Version | |
9.7.0.5 |