Solved

Illegal GO_ITEM  in form

Posted on 2014-03-14
13
1,376 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
 

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

 
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.

Join & Write a Comment

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now