Thanx ! I tried using a "compound statement block" in my Command Editor
session and it returned an error.
BEGIN ATOMIC
DECLARE v_rows INT
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "INT" was found followin
If I can use 'blocking' in CLP or Command Editor, it would solve my woes
...
> You can declare variables in "a compound statement block, which groups
> multiple independent SQL statement into single block".
[quoted text clipped - 14 lines]
> HTH,
> Adrian
Knut Stolze - 14 Feb 2006 09:00 GMT
> Thanx ! I tried using a "compound statement block" in my Command Editor
> session and it returned an error.
[quoted text clipped - 8 lines]
> If I can use 'blocking' in CLP or Command Editor, it would solve my woes
> ...
Which version of DB2 are you running and on which platform?
What are you using as statement terminator?
Your statement worked quite fine for me, suggesting that you have some other
problem, not related to the statement itself.
$ db2 -td@
db2 => begin atomic
db2 (cont.) => declare v_rows int;
db2 (cont.) => set v_rows = 1;
db2 (cont.) => end@
DB20000I The SQL command completed successfully.

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
Randy - 15 Feb 2006 01:42 GMT
I have the personal edition at home. I haven't tried this stuff at the
office yet.
DB2 UDB 8.1.1 / Windows XP
CLP says DB2/NT 8.2.3
My terminator is ; that's what it says at the bottom of the Command Editor
windows.
Randy
>> Thanx ! I tried using a "compound statement block" in my Command Editor
>> session and it returned an error.
[quoted text clipped - 24 lines]
> db2 (cont.) => end@
> DB20000I The SQL command completed successfully.
Knut Stolze - 15 Feb 2006 07:40 GMT
> DB2 UDB 8.1.1 / Windows XP
> CLP says DB2/NT 8.2.3
> My terminator is ; that's what it says at the bottom of the Command Editor
> windows.
Try a different statement terminator first. The thing is that the single
SQL statements inside a dynamic compound statement must always be
terminated with a ';'. So you should a different terminator for the
dynamic compound statement (DCS) itself. Otherwise, DB2 will assume at the
first ';' that the DCS is finished now, and when it parses the stuff from
the BEGIN ATOMIC ... to the INT, it finds a syntax error as at least the
closing END keyword is missing.

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
Randy - 16 Feb 2006 01:06 GMT
Works for me now. Thank you !
>> DB2 UDB 8.1.1 / Windows XP
>> CLP says DB2/NT 8.2.3
[quoted text clipped - 10 lines]
> the BEGIN ATOMIC ... to the INT, it finds a syntax error as at least the
> closing END keyword is missing.