473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

UDB 8.2.2 specify statement-delimiter inside script?

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
9 13710
_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
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
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

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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

47
by: Andrey Tatarinov | last post by:
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable...
2
by: pohmart | last post by:
I am using Xerces 2.6.2 and SAX on Windows2k. I want to validate an XML doc, which has no schema reference, with an external schema which is on my PC. I am setting the following properties and...
2
by: hype | last post by:
Hi, 1) If I need to monitor a resource eg, bufferpools at the database level across all users, how can I do this ? If snapshot monitoring needs to be done wouldn't enabling the switch at the DBM...
14
by: Siv | last post by:
Hi, I just discovered that if in an ADO.NET query I use: "Select * from Invoices Where InvoiceDate BETWEEN StartDate AND EndDate;" In this case StartDate would be 1st of month and EndDate...
3
by: Scottie_do | last post by:
I'm considering switching to C# and using VS2005, but I'd like to know if I can have a list of values at runtime and then specify (at runtime) what it's value type is. For example, I would have...
2
by: shorti | last post by:
Can you not use the 'FOR READ ONLY' option with the cursor declare unless you put the SELECT statement in the declare? re: EXEC SQL DECLARE c2 CURSOR FOR s2 FOR READ ONLY; errors with:
3
by: Antonio | last post by:
Can somebody tell my why the following procedure changes the data in the fields being updated to all the records in the database? private void updateRow(object source,...
9
by: noor.rahman | last post by:
I was wondering how it may be possible to query 2 MySQL databases using one query statement from PHP. For instance: SELECT database1.tableA.field1 UNION database2.tableB.field2. My concern...
3
by: kwatch | last post by:
What is the condition of module name which is available in 'from .. import ..' statement ? ---------------------------------------- import os print os.path # <module 'posixpath'...
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.