Home » Developer & Programmer » Forms » can i do "continue"
can i do "continue" [message #172608] Wed, 17 May 2006 05:54 Go to next message
emadbsb
Messages: 334
Registered: May 2005
Location: egypt
Senior Member

Hii all

I want to know if there in pl/sql phrase that makes the mean of "continue"

see this for a trigger keydel record
Quote:


SELECT COUNT(*) INTO vCOUNT_ACC
FROM GACCOXXXX
WHERE GACTY_CODE = :CODE;

IF (vCOUNT_ACC > 0) THEN
MESSAGE ('HAVE DETAIL IN ACCOUNTS SCREENS');
MESSAGE ('HAVE DETAIL IN ACCOUNTS SCREENS');
RAISE FORM_TRIGGER_FAILURE;
ELSE
DELETE_RECORD;
END IF;




this checks if there is child records found in other table
if so it raises form trigger failure
if it is not found

then then continue the action of delete
i have to write in my code "delete_record" although the trigger is fired when i delete record

if i didnot write "delete_record" the form even if there is a record can be deleted

i want instead of "delete_record" something like continue


thanks for everyone helped and helping me
Re: can i do "continue" [message #172686 is a reply to message #172608] Wed, 17 May 2006 11:40 Go to previous messageGo to next message
vijaykkiran
Messages: 5
Registered: April 2006
Junior Member
hi!

Your questions states that when the KeyDel Record trigger fires your code will executes...

there is no errors in that code but you must remember that continue is the reserved word for using in loops only, if you place a continue in that code, it will shows error.. please note that in the else part the Delete_record is used to delete the duplicate record... instead of deleting the duplicate record you want to proceed to move to another record... if so use the keyword " next_record ". this will skips the cursor record to the next record...
or else you may use the "NULL" keyword for nothing to do in the trigger action...

if you feel better you can do this else, find someother ways..
thank you...
Re: can i do "continue" [message #172715 is a reply to message #172608] Wed, 17 May 2006 13:27 Go to previous messageGo to next message
emadbsb
Messages: 334
Registered: May 2005
Location: egypt
Senior Member

Thanks for your reply

But i don't mean "continue" as a reserved word
i meant it as an action (continue compilation of the code or in other words continue the action of the trigger (delete record))

Re: can i do "continue" [message #172732 is a reply to message #172715] Wed, 17 May 2006 16:30 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is a default situation: there's no code in KEY-DELREC trigger. When you press KEY-DELREC, record will be deleted (or perhaps not, if there is a child record - then it will raise an error).

When you put YOUR CODE into the KEY-DELREC trigger, it is no longer default but user-defined. You decided to put the code we saw in your first post in there. Also, there might have been, for example

EXECUTE_QUERY;

or

MESSAGE('Hello, world!');

as the trigger code. None of those will perform key's default action - delete record - unless you code it explicitely.

Therefore, if you want the record to be deleted, DELETE_RECORD must exist somewhere in trigger. There's no way to "force" it to "continue" (as you said) with record deletion unless you tell it to.
Previous Topic: sequence nos
Next Topic: Cannot access DB Objects from form,Report,Proc Builder
Goto Forum:
  


Current Time: Fri Sep 20 09:51:13 CDT 2024