?
Solved

Illegal GO_ITEM  in form

Posted on 2014-03-14
13
Medium Priority
?
2,407 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 21

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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses
Course of the Month13 days, 20 hours left to enroll

807 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