All Forums Database
k1ng 16 posts Joined 06/08
14 Nov 2014
proc call in bteq ansi mode error

I'm trying to call a procedure via bteq but I keep getting a:

*** Error 3722 Only a COMMIT WORK or null statement is legal after a DDL Statement.

Here is my code:

prvcy_call () { bteq
.set session transaction ansi;
$(cat $HOME/.tdlogon)
DATABASE db;
$1
.LOGOFF;
.QUIT;
.EXIT
}

prvcy_call "CALL PPROC.procedureAbcd (
'p1',
'p2',
'p4',
'p4' ;"

not sure whats wrong as it works in sql assistant..
I've tried this too:

prvcy_call "CALL PPROC.procedureAbcd (
'p1',
'p2',
'p4',
'p4' ;

COMMIT;"

but get the same error

dnoeth 4628 posts Joined 11/04
14 Nov 2014

You need to COMMIT the DATABASE command :-)

Dieter

Dany3R9 18 posts Joined 03/14
28 Oct 2015

Thanks dnoeth, as usual!

You must sign in to leave a comment.