Solved

Illegal GO_ITEM  in form

Posted on 2014-03-14
13
1,788 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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 video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

735 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