Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Trigger

Status
Not open for further replies.

Christi

Programmer
Dec 28, 2001
14
US
can someone please take a look at this trigger and explain to me why it is not working.
What I am trying to do is make sure that cursor is moved to a specific field before an update is done on that table.
the algorithm is like this:
pre-update trigger
before update on tableName
next_item = vdate;
this is how I coded it:

Trigger name PRE-UPDATE:

DECLARE
cur_itm VARCHAR280) := :System.Cursor_Item;
cur_blk VARCHAR2(80) := :System.Cursor_Block;
call_vdate VARCHAR2(80); -- this is the field on table

BEGIN
call_vdate := cur_blk||'.'||Get_Block_Propertycur_blk,LAST_ITEM);
IF cur_itm = call_vdate THEN
Next_Block;
ELSE
call_vdate := Next_Item;
END IF;
END;

It is kicking out some errors. can anyone help, please

 
1) You cannot use navigational triggers in restricted triggers.

If you need to do any navigation then do it from the key-commit trigger before calling the commit built-in.

2) You cannot assign a value from a built-in (call_vdate := Next_Item;)

Try call_vdate := Get_Item_Property:)SYSTEM.CURSOR_ITEM,NEXTITEM);
 
lewisp thank you.
I do have a follow-up question.
To use the go-item trigger, where do I go?
I mean do I go to the block or item, click trigger and select when-validate-item or what?
I tried selecting go-item trigger but it is not pulling that up.
I am sorry, I am new at this.
 
sorry!
i found where to go on your response - key-commit
thanks again.
I am really dumb!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top