473,471 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Trigger calling INVALID SP - strange behaviour ?

Hi,

FYI & comment:

We have triggers that call SPs.

If the Stored Procedure is invalidated, e.g a dependent table is dropped.
The SP is marked as invalid, but no error is thrown by the trigger!!

i.e the trigger performs no action, but because there is no error, this can
easily go unnoticed (as it has been in our scenario)

Is this working as designed? surely you would want the trigger to error?

We have coded around this by checking a return code from the SP for NULL (which
it seems to be when the SP is invalid)

i.e
declare rc_sqlstate char(5) default '00000'

call my_stored_proc(...... OUT rc_sqlstate);

if ((rc_sqlstate <> '00000') or (rc_sqlstate is null))THEN
ERROR ....
Nov 12 '05 #1
3 2776
Paul Reddin wrote:
Hi,

FYI & comment:

We have triggers that call SPs.

If the Stored Procedure is invalidated, e.g a dependent table is dropped.
The SP is marked as invalid, but no error is thrown by the trigger!!

i.e the trigger performs no action, but because there is no error, this can
easily go unnoticed (as it has been in our scenario)

Is this working as designed? surely you would want the trigger to error?

We have coded around this by checking a return code from the SP for NULL (which
it seems to be when the SP is invalid)

i.e
declare rc_sqlstate char(5) default '00000'

call my_stored_proc(...... OUT rc_sqlstate);

if ((rc_sqlstate <> '00000') or (rc_sqlstate is null))THEN
ERROR ....

Which platform are you on?
What should happin is that the stored procedure tries to rebind upon
CALL. If you haven't recreated the table by that time you should get an
error stating that an implicit rebind failed.
This shoudl be returned by teh CALL statement which shoudl fail the
trigger and roll back teh entire statement.
So... I would expect a:
SQLCODE -723 (trigger failed) with embeddend token: <sqlcode/state of
implicit rebind>, -204 (object not found), <tablename>
Something like that.

Cheres
Serge
Nov 12 '05 #2
Serge Rielau <sr*****@ca.ibm.com> wrote in message news:<31*************@uni-berlin.de>...
Which platform are you on?
V8.2 Linux (RHAT).
What should happin is that the stored procedure tries to rebind upon
CALL. If you haven't recreated the table by that time you should get an
error stating that an implicit rebind failed.
Doesn't look like it's doing this.

We'll investigate further and raise a PMR. I was keen to know
if anybody else was/has experienced this?


Cheres
Serge

Nov 12 '05 #3
after drop depended table. But on REBIND invalid_package db2 say SUCCESS.
May be it's no good...

And may be You known method how dba can find thats packages (after success
rebind)?

Andy

create procedure test
language sql
begin
select 1 from test;
end

drop table test /* package for sp test in invalid state */

rebind package for sp test /* look on successfully*/
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Hannu Kankaanp?? | last post by:
This may be a bug or simply a strange result of undefined behaviour, but this is what I get with Python 2.3.2 on Windows XP: >>> import os >>> os.listdir('') >>> os.listdir(u'')
1
by: Simon Holmes | last post by:
Hi, I am having trouble calling a UDF from a 'before update' trigger whereas I have no problems calling it from the 'after update' trigger. The trigger is as below : CREATE TRIGGER foo NO...
4
by: Paul Reddin | last post by:
Hi, Having just tested our database on V8.2 we get the following apparent incompatibility. A Trigger conatains the following line CREATE TRIGGER JABS.AU_CHNG_ENQUIRYITM AFTER UPDATE OF ..
6
by: JohnO | last post by:
Hi Folks, I have an update trigger that fails (it inserts an audit table record) in some circumstances. This is causing the triggering transaction to fail and roll back. Is there any way to...
9
by: steven | last post by:
Does anyone know how to do the following. I'm trying to mimic replication with triggers. I have 2 databases, each have these 2 tables. 1. USERS ID int NAME varchar(20)
6
by: Alex Vinokur | last post by:
------ foo.c ------ void func() {} int main() { func (100, 200, 300); return 0; } ------------------- How can func() use its arguments 100, 200, 300?
3
by: yinzara | last post by:
I have the following trigger that calls a DB2 stored procedure: DROP TRIGGER GGWU.TRI_A_MULTI_PROP@ CREATE TRIGGER GGWU.TRI_A_MULTI_PROP AFTER INSERT ON GGWU.MULTIPLIER_PROPERTY REFERENCING ...
11
by: tracy | last post by:
Hi, I really need help. I run this script and error message appeal as below: drop trigger log_errors_trig; drop trigger log_errors_trig ERROR at line 1: ORA04080: trigger 'LOG_ERRORS-TRIG'...
3
by: lenygold via DBMonster.com | last post by:
Thank you very much SERGE for your help. I found example in Graeme Birchall COOKBOOK wich i think exactly what i need for SQL check in triggers: • User query joins to table function - sends...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.