473,651 Members | 3,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_DELIM ITER %".

Someone told me there was something for this in new versions of DB2,
but I cannot find it yet.

Nov 12 '05 #1
9 13743
_l*****@yahoo.c om 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_DELIM ITER %".


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 "Documentat ion 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************ **********@o13g 2000cwo.googleg roups.com>,
(_l*****@yahoo. com) says...

Magic.

Thanks Serge.

Now that I see the syntax, this info has made it into the online
infocentre under "Documentat ion 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************ **********@o13g 2000cwo.googleg roups.com>,
(_l*****@yahoo. com) says...
Magic.

Thanks Serge.

Now that I see the syntax, this info has made it into the online
infocentre under "Documentat ion 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.ne t>, Serge Rielau
(sr*****@ca.ibm .com) says...
Gert van der Kooij wrote:
In article <11************ **********@o13g 2000cwo.googleg roups.com>,
(_l*****@yahoo. com) says...
Magic.

Thanks Serge.

Now that I see the syntax, this info has made it into the online
infocentre under "Documentat ion 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************ ************@ne ws.xs4all.nl>, Gert van der
Kooij (ge**@invalid.n l) 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************ ************@ne ws.xs4all.nl>, Gert van der
Kooij (ge**@invalid.n l) 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
3619
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 sources. Usage could be something like: >>> res = where: >>> def f(x):
2
4770
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 features: saxParser.setFeature("http://xml.org/sax/features/namespaces", true); saxParser.setFeature("http://xml.org/sax/features/namespace-prefixes", true); saxParser.setFeature("http://xml.org/sax/features/validation", true);...
2
3057
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 level cause performance problems ? 2)How does one find the SQL statement that a particular user session is executing? TIA,
14
5668
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 would be the last day of the month, e.g. 31/08/2005 (UK DD/MM/YYYY format) I find that the query is missing off any invoices that were done on the 31st of the Month, in other words if in the between statement I don't specify a time, ADO.NET or Jet...
3
2488
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 this in my Multi-Dimensional Array named people Then, I would then like to say: new Person<People.ToString>(); Where ToString() would output a built in datatype or a struct/object that I
2
3386
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
1395
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, System.Web.UI.WebControls.DataGridCommandEventArgs e) { SqlConnection conn = new SqlConnection (ConfigurationSettings.AppSettings); SqlCommand updCommand = new SqlCommand();
9
5845
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 is, when connecting to MySQL (or sending a query), I only specify 1 database connection resource ID. How does that play out when connecting to 2 databases?
3
2000
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' from '/usr/local/ lib/python2.5/posixpath.pyc'> from posixpath import sep # (no errors) from os.path import sep # (no errors, wow!) path = os.path
18
7958
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 defintion of "expression" and "statement"? What is the difference between an expression and a statement?
0
8811
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8703
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7302
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5619
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.