By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,554 Members | 1,084 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,554 IT Pros & Developers. It's quick & easy.

UDB 8.2.2 specify statement-delimiter inside script?

P: n/a
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.

Nov 12 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
_l*****@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 (;) as
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
Nov 12 '05 #2

P: n/a
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.

Nov 12 '05 #3

P: n/a
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
Nov 12 '05 #4

P: n/a

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.

Nov 12 '05 #5

P: n/a
In article <11**********************@o13g2000cwo.googlegroups .com>,
(_l*****@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?
Nov 12 '05 #6

P: n/a
Gert van der Kooij wrote:
In article <11**********************@o13g2000cwo.googlegroups .com>,
(_l*****@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
Nov 12 '05 #7

P: n/a
In article <3n*************@individual.net>, Serge Rielau
(sr*****@ca.ibm.com) says...
Gert van der Kooij wrote:
In article <11**********************@o13g2000cwo.googlegroups .com>,
(_l*****@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?
Nov 12 '05 #8

P: n/a
In article <MP************************@news.xs4all.nl>, Gert van der
Kooij (ge**@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.
Nov 12 '05 #9

P: n/a
Gert van der Kooij wrote:
In article <MP************************@news.xs4all.nl>, Gert van der
Kooij (ge**@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
Nov 12 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.