Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    8

    Unanswered: 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?

  2. #2
    Join Date
    Jun 2009
    Location
    Lisboa, Portugal
    Posts
    78
    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.

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •