F0cus
F0cus

Reputation: 625

Oracle Forms Execute_query giving FRM-40737 error

I am getting an error

FRM - 40737 - illegal restricted procedure GO_BLOCK in WHEN-VALIDATE-RECORD trigger.

My Code is

IF event_name = 'WHEN-VALIDATE-RECORD'
      THEN
         IF (form_name = 'OEXOEORD' AND block_name = 'ORDER')
         THEN
            -- call procedure to validate and cascade the ship method code.
            cascade_ship_method;
         execute_query;
         END IF;

What am I doing wrong here ?

Upvotes: 1

Views: 10685

Answers (2)

phileoseda
phileoseda

Reputation: 292

It might be relevant with content of cascade_ship_method. When I got this error, I had missed an apostrophe in the SET_BLOCK_PROPERTY statement. When I fixed, it worked. This is the correct structure in my code block:

SET_BLOCK_PROPERTY (
                  'TABLE_A',
                  default_where,
                     'column_a= '
                  || ''''
                  || variable
                  || '''');

Upvotes: 0

Petr Pribyl
Petr Pribyl

Reputation: 3575

This is because Oracle Forms has two types of built-in procedures - restricted and unrestricted. Some triggers enable restricted procedures, some not (see Oracle Forms help, every trigger has information which procedures it enables).

Trigger WHEN-VALIDATE-ITEM fires for example when user moves cursor from one record to the other (this is called navigation). In this case it leaves one record and enters other. There is fired following chain of triggers

  • WHEN-VALIDATE-ITEM
  • WHEN-VALIDATE-RECORD
  • POST-ITEM
  • POST-RECORD
  • PRE-RECORD
  • PRE-ITEM

If any of this trigger fails, navigation is canceled and cursor returns to the original item. If you call any procedure, which starts new navigation (like GO_BLOCK), Oracle Forms would not be able to manage first navigation.

This is, why some procedures are restricted.

Upvotes: 2

Related Questions