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

CALL in TRIGGER and SQLCODE -746

P: n/a
Hi All,

I'd like to get feedback (through email) from folks who use CALL in
Trigger and do or do not get in trouble with the -746 SQLCODE:

SQL0746N Routine "<routine-name>" (specific name
"<specific-name>") violated nested SQL statement rules
when attempting to perform operation "<operation>" on
table "<table-name>".

Cheers
Serge
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hello Serge,
(Using DB2 8.2/Linux)
Hi All,

I'd like to get feedback (through email) from folks who use CALL in Trigger and do or do not get in trouble with the -746 SQLCODE:
SQL0746N Routine "<routine-name>" (specific name "<specific-name>") violated nested SQL statement rules when attempting to perform
operation "<operation>" on table "<table-name>".
Cheers
Serge


Here you've got it:

create table a (a integer)
@
create procedure b1(i_a integer)
begin
insert into a values (i_a);
end
@
create table b (a integer)
@
create trigger t_b after insert on b referencing new as nuevo for each
row mode db2sql
begin atomic
call b1(nuevo.a);
call b1(nuevo.a);
--insert into a values (nuevo.a);
--insert into a values (nuevo.a);
end
@
insert into b values (0)
@
insert into b values (1)
@
insert into b values (2)
@
select * from a
@
drop table b
@
drop procedure b1
@
drop table a
@
drop trigger t_b
@

Commenting the CALLs and uncommenting the INSERTs works fine. CALL
works if there's only one CALL.
Needless to say I'm desperate with this one.

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.