Solved

Illegal GO_ITEM  in form

Posted on 2014-03-14
13
1,613 Views
Last Modified: 2014-03-17
hi
i'm using oracle form 6i
i used go_items in many : when_validate_items  but it always sent me an error
frm-40737
desc v_emp
Name                           Null     Type                                                                                                                                                                                          
------------------------------ -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
EMP_ID                         NOT NULL NUMBER(15)                                                                                                                                                                                    
MAIN_ID                                 NUMBER(5)                                                                                                                                                                                     
V_STAT_TYPE                             NUMBER(1)                                                                                                                                                                                     
EMP_NO                                  NUMBER(6)                                                                                                                                                                                     
REMARK                                  VARCHAR2(255)                                                                                                                                                                                 
POSTING_DATE                            DATE                                                                                                                                                                                          
POSTED_BY                               VARCHAR2(50)                                                                                                                                                                                  
LOCATION                                NUMBER(5)                                                                                                                                                                                     
SUB_EMP_ID                              NUMBER(10)                                                                                                                                                                                    

9 rows selected

Open in new window


in the form , block v_emp
it is ascended like this
V_STAT_TYPE        then  emp_no then location
here is sample of one code
if :v_stat_type = 2  then
go_item(:v_emp.location);
end if;

Open in new window

0
Comment
Question by:NiceMan331
  • 6
  • 6
13 Comments
 
LVL 20

Expert Comment

by:flow01
ID: 39931934
Your giving as an argument of the go_item the value of the item v_emp.location (for example : 'New York' instead of the name of the item.
Try changing it to go_item('v_emp.location');
0
 

Author Comment

by:NiceMan331
ID: 39932227
i did
but same error
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39933539
I think that problem is caused by using restricted built-in GO_ITEM in When-Validate-Item trigger where Legal Commands are SELECT statements and unrestricted Built-ins.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:NiceMan331
ID: 39933542
so , what do you think the solution could be ?
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39933556
Instead of GO_ITEM I would display message to a user. You can also clear the value of item where validation fails.
0
 

Author Comment

by:NiceMan331
ID: 39933571
the idea is , when value of item is 2 for example , so need to go next item
directly skip and go to a specific item in the block
0
 
LVL 22

Accepted Solution

by:
Helena Marková earned 500 total points
ID: 39933594
Maybe you can use a timer.

When-Validate-Item trigger:
DECLARE
timer_id Timer;
BEGIN
if :v_stat_type = 2  then
timer_id :=create_timer('MY_TIMER_1',5,NO_REPEAT);
end if;
END;

In When-Timer-Expired trigger there will be GO_ITEM:
DECLARE
    X_S_TIMER_NAME VARCHAR2(30);
BEGIN
    X_S_TIMER_NAME := GET_APPLICATION_PROPERTY(TIMER_NAME);
   
    CASE X_S_TIMER_NAME
      WHEN X_S_TIMER_NAME='MY_TIMER_1' THEN
          GO_ITEM('V_EMP.LOCATION');
    ELSE
-- here you can add another timers
      NULL;
    END CASE;    
END;
0
 

Author Comment

by:NiceMan331
ID: 39933683
now is ok
thanx
plz tell me , how timer solve it ?
what is the mechanizm of timer
it is a solution of what ?
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39933688
Timer is something like an internal clock. Here is the description from the Forms on-line help:

About Timers
 
A timer is an "internal time clock" that you programmatically create to perform an action each time the timer expires.

Timer duration can be between 1 and 2,147,483,647 millisecond (1 second=1000 milliseconds). The maximum duration of a timer is approximately 24.85 days.

When you work with timers you perform these steps:
Create the desired number of repeating or non-repeating timers using the CREATE_TIMER Built-in subprogram.
 Create a When-Timer-Expired trigger that performs the desired action whenever your timer expires.

Related topics

About timer usage rules
Creating a timer
Responding to multiple timers
CREATE_TIMER Built-in
When-Timer-Expired Trigger

You can find more about it in the Forms on-line help.
0
 

Author Comment

by:NiceMan331
ID: 39933869
ok i agree with you
but sorry to repeat another question
did go_item fail due to time reason , so the timer solve it ?
sorry again , i just want to understand why it fail there , then it success with timer
with full thanx
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39933909
There was no time reason there.
GO_ITEM is restricted built-in. If it is used in When-Validate-Item trigger, it fails, because in this trigger only unrestricted built-ins can be used.
When GO_ITEM was replaced with CREATE_TIMER,
the timer was created,
When-Validate-Item trigger was processed to the end
and when timer expired then When-Timer-Expired fired. In this trigger restricted built-ins can be used.
0
 

Author Comment

by:NiceMan331
ID: 39933912
ok , now i got it
thanx
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 39933926
Have a nice day :).
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to recover a database from a user managed backup

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question