If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Disable trigger from 4gl

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-17-09, 09:38
Chrys777 Chrys777 is offline
Registered User
 
Join Date: Jun 2008
Posts: 8
Disable trigger from 4gl

Hello

I am trying to disable all the triggers of a table before updating some records. This is my code:

Code:
prepare s_trigger_off from "set triggers for table disabled"
execute s_trigger_off

prepare p_stmt from stmt
execute p_stmt 

prepare s_trigger_on from "set triggers for table enabled"
execute s_trigger_on
I get the following error:

Code:
Program error at "update.4gl", line number 80.
SQL statement error number -242.
Could not open database table (database.table).
SYSTEM error number -106.
ISAM error:  non-exclusive access.
Any ideas what I am doing wrong?
Reply With Quote
  #2 (permalink)  
Old 06-17-09, 21:08
Luis Santos Luis Santos is offline
Registered User
 
Join Date: Jun 2009
Location: Lisboa, Portugal
Posts: 50
Hi,

Do you database is with transactions?

If no, then you should use first "LOCK TABLE tablename IN EXCLUSIVE MODE", after that "UNLOCK TABLE tablename"

If yes, you need to use "BEGIN WORK" before you update statement and "COMMMIT WORK" after the execution.

I hope it works.

Bye.
Reply With Quote
  #3 (permalink)  
Old 06-19-09, 10:40
Chrys777 Chrys777 is offline
Registered User
 
Join Date: Jun 2008
Posts: 8
Quote:
Originally Posted by Luis Santos
Hi,

Do you database is with transactions?

If no, then you should use first "LOCK TABLE tablename IN EXCLUSIVE MODE", after that "UNLOCK TABLE tablename"

If yes, you need to use "BEGIN WORK" before you update statement and "COMMMIT WORK" after the execution.

I hope it works.

Bye.
I found the problem. I was performing a fetch command that was locking the table. I changed it to execute and is working fine now. Thanks for the help Luis
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On