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.
I am coding a shell script that takes a procedure name as input and gives the DDL of procedure as output by parsing db2look output.I am checking for create procedure statement and then checking for END statement followed by semicolon.
Do you think the above logic would work for all kinds of SQL stored procedure??
If you are going to count BEGIN and END statements, then you are also going to have to count IF, LOOP, WHILE, and every other statement that ends with END.
You can run db2look with specifying your own statement terminator (other than the default ";"). It will still use ";" at the end of each line, but will use the terminator you specify at the end of the SP. I prefer using the "@" symbol. This should solve your problem.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390