Normally I use the semicolon for statement delimiters in plain SQL
scripts (for DDL, simple DML etc.).
But inside SQL/PL I tend to use % or @ as statement delimiters. But
other people prefer other delimiters.
I know that I can use the CLP option "-td" to specify the delimiter on
the command line, when invoking the script. But this requires me to
look inside the scripts to find the delimiter before I run the script.
It would be nice for the script itself to be able to declare its own
delimiter inside itself, thereby allowing calling scripts to not-care
about which delimiter(s) are used inside of any particular script, and
if the script did not make any such declaration then some default (like
semicolon etc) would apply. Something like "SET STATEMENT_DELIM ITER %".
Someone told me there was something for this in new versions of DB2,
but I cannot find it yet.
scripts (for DDL, simple DML etc.).
But inside SQL/PL I tend to use % or @ as statement delimiters. But
other people prefer other delimiters.
I know that I can use the CLP option "-td" to specify the delimiter on
the command line, when invoking the script. But this requires me to
look inside the scripts to find the delimiter before I run the script.
It would be nice for the script itself to be able to declare its own
delimiter inside itself, thereby allowing calling scripts to not-care
about which delimiter(s) are used inside of any particular script, and
if the script did not make any such declaration then some default (like
semicolon etc) would apply. Something like "SET STATEMENT_DELIM ITER %".
Someone told me there was something for this in new versions of DB2,
but I cannot find it yet.
Comment