Home » Developer & Programmer » Forms » how to delete record
how to delete record [message #416043] Thu, 30 July 2009 04:49 Go to next message
simcky
Messages: 38
Registered: July 2009
Member
hello
guy's i want that when i press a push button then my record should get delete from the database
for this i m writting
delete_record;
built-in but this is deleting the particular record only from the form but not from the database and if i m writting
DELETE_RECORD;
COMMIT;
then instead of deletion insertion is happening in my form actually what's happening is the particular record on which my cursor is deleting but all other records are getting commiting any solution for the problem . Sad
Re: how to delete record [message #416049 is a reply to message #416043] Thu, 30 July 2009 04:59 Go to previous messageGo to next message
saeid
Messages: 22
Registered: May 2008
Junior Member
Hi ,
instead of using delete_record
use a database function and call it in your form.

don`t forget write "PRAGMA AUTONOMOUS_TRANSACTION;"
in the declaration of your function.
use "commit;" in the function.
Re: how to delete record [message #416072 is a reply to message #416043] Thu, 30 July 2009 06:15 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Do not do that. That is not a sensible use of autonomous transactions at all.

@smicky
What you've described is the way forms is supposed to work.
Delete_record issues a delete command for the current record.
No delete or insert or update from forms is made permanent untill you commit.
Commit commits all changes in your form since the last commit.

Just use delete_record and let the user commit the changes themselves with the save button.
Re: how to delete record [message #416092 is a reply to message #416072] Thu, 30 July 2009 07:40 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Or, don't reinvent the wheel. If you use default Forms toolbar, it already contains the "delete record" button (a little red cross icon). Teach your users to use it.
Previous Topic: compilation error
Next Topic: report_object_status [ERROR]
Goto Forum:
  


Current Time: Fri Sep 20 09:29:19 CDT 2024