Home » Developer & Programmer » Forms » key-delrec (oracle 8i)
key-delrec [message #458313] Fri, 28 May 2010 10:25 Go to next message
theowais
Messages: 75
Registered: October 2009
Location: Multan
Member
I want to delete a record.

On push button when I write the following code :

do_key('delete_record');
commit;

--it works

But when I write the same code in KEY-DELREC trigger and

on push button I write following code :

execute_trigger('KEY-DELREC');

--it does not work

can any one help me???

Re: key-delrec [message #458360 is a reply to message #458313] Fri, 28 May 2010 15:16 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Simply - don't code it. Let Forms do the job. Pressing the "delete record" button on a form toolbar will delete a record.

If you insist on reinventing the wheel, then WHEN-BUTTON-PRESSED trigger (the one that deletes a record - that's how I understood what you said) should have only
delete_record;
(Commit? Up to you.)
Re: key-delrec [message #458367 is a reply to message #458360] Fri, 28 May 2010 22:19 Go to previous messageGo to next message
theowais
Messages: 75
Registered: October 2009
Location: Multan
Member
It works.

But when I close the form there is a message :

Do you want to save the changed you have made???

I wish when it delete the record it must also perform commit to avoid message on closing form.
Re: key-delrec [message #458404 is a reply to message #458367] Sat, 29 May 2010 10:41 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I said that it is up to you. If you want to commit, then
delete_record;
commit;

If you want to leave the final decision to the end user, omit COMMIT.
Re: key-delrec [message #458411 is a reply to message #458404] Sat, 29 May 2010 12:04 Go to previous message
theowais
Messages: 75
Registered: October 2009
Location: Multan
Member
Thank you very very much for you support.
Previous Topic: Dev9i AS Icons Disappear At Runtime
Next Topic: Query records of detail block displayed in single row
Goto Forum:
  


Current Time: Thu Sep 19 19:52:42 CDT 2024