vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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_DELIMITER %". Someone told me there was something for this in new versions of DB2, but I cannot find it yet. |
| |||
| _link98@yahoo.com wrote: > 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_DELIMITER %". In the DB2 doc I just find this: Statement Termination Character Option (-t): The -t option tells the command line processor to use a semicolon ( the statement termination character, and disables the backslash (\) line continuation character. Note: This option *cannot* be changed from within the interactive mode. http://publib.boulder.ibm.com/infoce...e/r0010410.htm -- Knut Stolze Information Integration Development IBM Germany / University of Jena |
| |||
| Knut, It seems you answered a different question than the one that I asked. The -t option is not settable *inside* a script (via "update command options"), according to the docs .. I'm asking if a script can specify its delimiter inside the file, rather than via the command-line. I know I can parse the file to find the delimiter, but it seems a kludge. |
| |||
| db2 => --#SET TERMINATOR % db2 => values 1% 1 ----------- 1 1 record(s) selected. db2 => --#SET TERMINATOR ; db2 => values 1; 1 ----------- 1 1 record(s) selected. db2 => Cheers Serge -- Serge Rielau DB2 SQL Compiler Development IBM Toronto Lab |
| |||
| Magic. Thanks Serge. Now that I see the syntax, this info has made it into the online infocentre under "Documentation updates". Since fp1 of v8.1. Message to self: ingest that section as carefully as the release notes. |
| |||
| In article <1124805269.296822.287270@o13g2000cwo.googlegroups .com>, (_link98@yahoo.com) says... > > Magic. > > Thanks Serge. > > Now that I see the syntax, this info has made it into the online > infocentre under "Documentation updates". > > Since fp1 of v8.1. Message to self: ingest that section as carefully as > the release notes. > > I only could find it in the Db2 z/OS docs, not in the DB2 Unix/Windows docs. Did I miss it? |
| |||
| Gert van der Kooij wrote: > In article <1124805269.296822.287270@o13g2000cwo.googlegroups .com>, > (_link98@yahoo.com) says... > >>Magic. >> >>Thanks Serge. >> >>Now that I see the syntax, this info has made it into the online >>infocentre under "Documentation updates". >> >>Since fp1 of v8.1. Message to self: ingest that section as carefully as >>the release notes. >> >> > > > I only could find it in the Db2 z/OS docs, not in the DB2 > Unix/Windows docs. Did I miss it? New in FP8 you need to go to the online docs @boulder Cheers Serge -- Serge Rielau DB2 SQL Compiler Development IBM Toronto Lab |
| |||
| In article <3n1mssF18vou5U1@individual.net>, Serge Rielau (srielau@ca.ibm.com) says... > Gert van der Kooij wrote: > > In article <1124805269.296822.287270@o13g2000cwo.googlegroups .com>, > > (_link98@yahoo.com) says... > > > >>Magic. > >> > >>Thanks Serge. > >> > >>Now that I see the syntax, this info has made it into the online > >>infocentre under "Documentation updates". > >> > >>Since fp1 of v8.1. Message to self: ingest that section as carefully as > >>the release notes. > >> > >> > > > > > > I only could find it in the Db2 z/OS docs, not in the DB2 > > Unix/Windows docs. Did I miss it? > New in FP8 you need to go to the online docs @boulder > > Cheers > Serge > Could not find it there either, can you post a (tiny) url? |
| |||
| In article <MPG.1d76bea580f53e0a989872@news.xs4all.nl>, Gert van der Kooij (gert@invalid.nl) says... > > New in FP8 you need to go to the online docs @boulder > > > > Cheers > > Serge > > > > Could not find it there either, can you post a (tiny) url? > Sorry, found it allready. |
| ||||
| Gert van der Kooij wrote: > In article <MPG.1d76bea580f53e0a989872@news.xs4all.nl>, Gert van der > Kooij (gert@invalid.nl) says... > >>>New in FP8 you need to go to the online docs @boulder >>> >>>Cheers >>>Serge >>> >> >>Could not find it there either, can you post a (tiny) url? >> > > > Sorry, found it allready. well, now that I had to learn how to make tiny URLs you get it anyway: http://tinyurl.com/ba4po Cheers Serge -- Serge Rielau DB2 SQL Compiler Development IBM Toronto Lab |