Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2003
    Location
    Missouri, USA
    Posts
    18

    Question Unanswered: table level trigger doesn't like 'execute_query'

    I am using Oracle Designer 6i Forms. I have created a table level
    trigger. The trigger calls a function that derives a value for a
    column. It doesn't display it on the form once it is derived. I know
    that if this were a WHEN_BUTTON_PRESSED form level trigger I could use 'EXECUTE_QUERY' and 'SYNCHRONIZE' to get the form to requery and display the new values in the record. But, when I put this into the table trigger, Designer says that:

    CDS-11307 Warning: (compilation error in TRIGGER 'INSERT_NEW_ITEM' at
    18/7): PLS-00201: identifier 'EXECUTE_QUERY' must be declared

    CDS-11307 Warning: (compilation error in TRIGGER 'INSERT_NEW_ITEM' at
    18/7): PL/SQL: Statement ignored

    Same for the 'SYNCHRONIZE'. Is there a piece of code that I need to
    add or some characters before these, for them to be legit?

    Thanks much,
    Maggie

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: table level trigger doesn't like 'execute_query'

    EXECUTE_QUERY and SYNCHRONIZE are meaningful only within Forms. They are meaningless in a database trigger, or anywhere else outside of Forms. All your database trigger can do is manipulate data in the server, and optionally raise an exception to indicate an error.

  3. #3
    Join Date
    Oct 2003
    Location
    Missouri, USA
    Posts
    18

    Re: table level trigger doesn't like 'execute_query'

    So since the table level trigger can't requery. I guess I could put a button on the form that would be solely for requerying the current row in the block. This seems kind of cumbersome. Might you have any ideas or suggestions on this? Thanks, M

    Originally posted by andrewst
    EXECUTE_QUERY and SYNCHRONIZE are meaningful only within Forms. They are meaningless in a database trigger, or anywhere else outside of Forms. All your database trigger can do is manipulate data in the server, and optionally raise an exception to indicate an error.

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: table level trigger doesn't like 'execute_query'

    Difficult to say without knowing quite what you want to do. If a database trigger has just been fired, then your form must have issued a POST or COMMIT - so why not just add EXECUTE_QUERY to the end of the trigger that caused the POST or COMMIT?

  5. #5
    Join Date
    Oct 2003
    Location
    Missouri, USA
    Posts
    18

    Re: table level trigger doesn't like 'execute_query'

    The COMMIT was done by selecting the SAVE icon/button at the top of the form on the default toolbar. When the SAVE icon was selected was when the table level trigger fired. Can I add code to this SAVE?

    Originally posted by andrewst
    Difficult to say without knowing quite what you want to do. If a database trigger has just been fired, then your form must have issued a POST or COMMIT - so why not just add EXECUTE_QUERY to the end of the trigger that caused the POST or COMMIT?

  6. #6
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: table level trigger doesn't like 'execute_query'

    Yes. The SAVE icon is mapped to the KEY-COMMIT trigger. If your form doesn't already have a KEY-COMMIT trigger you can create one that looks like this:

    BEGIN
    COMMIT_FORM;
    -- Your additional processing here:
    EXECUTE_QUERY;
    END;

  7. #7
    Join Date
    Oct 2003
    Location
    Missouri, USA
    Posts
    18

    Re: table level trigger doesn't like 'execute_query'

    Okay, I will give that a try. Thank you so much for your help. :o)

Posting Permissions

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