Home » Developer & Programmer » Forms » Clear, insert button
Clear, insert button [message #120653] Sat, 21 May 2005 17:32 Go to next message
elMiMi
Messages: 5
Registered: May 2005
Location: QTR
Junior Member

Hi everyone
i'm trying to create a form and have two buttons, one to clear the form or reset it to null and another to insert the info into the table

my pl/sql code for "insert" looks like this but it wouldn't commit until i click on save, what should i do?

begin
insert into supervisor values (:staffid, :fname, :lname, :officeno);
commit;
:staffid:=' ';
:fname:=' ';
:lname:=' ';
:OfficeNo:=' ';
end;


And my clear is like this, but it doesn't work

begin
commit;
:staffid:=' ';
:fname:=' ';
:lname:=' ';
:OfficeNo:=' ';
end;


Thanx
Re: Clear, insert button [message #120659 is a reply to message #120653] Sun, 22 May 2005 02:33 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Forms can do all these things for you. There is a clear-form built-in; if you commit the record will be inserted automagically. Don't rewrite forms functionality!

hth
Re: Clear, insert button [message #120661 is a reply to message #120653] Sun, 22 May 2005 03:02 Go to previous messageGo to next message
elMiMi
Messages: 5
Registered: May 2005
Location: QTR
Junior Member


I know, but he wants us to write it from scratch
i know it's a waste of time

Thanx
Re: Clear, insert button [message #120805 is a reply to message #120661] Mon, 23 May 2005 18:24 Go to previous messageGo to next message
danosw
Messages: 20
Registered: May 2005
Location: California
Junior Member
Try using standard.commit instead of commit.

Are you sure you want to commit in the clear_button?
Re: Clear, insert button [message #120980 is a reply to message #120805] Wed, 25 May 2005 05:07 Go to previous message
Gurusubramanyam
Messages: 79
Registered: July 2001
Member
Hi,

Please try to utilize oracle forms features.Otherwise you will be loosing the control over transactions.

You can use the control blocks and On Triggers but still you can not acheive everything.

Thanks & Regards,
G.S
Previous Topic: how to get data from excel to oracle forms
Next Topic: Getting Backend message in Forms
Goto Forum:
  


Current Time: Wed Sep 18 21:19:31 CDT 2024