467,191 Members | 1,223 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,191 developers. It's quick & easy.

CALL in TRIGGER and SQLCODE -746

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
  • viewed: 2501
Share:
1 Reply
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.

Similar topics

2 posts views Thread by Tborn2b | last post: by
5 posts views Thread by Bob Stearns | last post: by
2 posts views Thread by mob1012 via DBMonster.com | last post: by
4 posts views Thread by Pakna | last post: by
2 posts views Thread by Massimiliano Campagnoli | last post: by
3 posts views Thread by cberthu@gmail.com | last post: by
2 posts views Thread by lenygold via DBMonster.com | last post: by
1 post views Thread by amijai11 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.