Home » Developer & Programmer » Forms » How to write query For ADD Button
How to write query For ADD Button [message #467267] Fri, 23 July 2010 02:30 Go to next message
swapnil_naik
Messages: 269
Registered: December 2009
Location: Mumbai
Senior Member

Hi Friends,

I am newbie in ORACLE Developement....Without using any templates, i created a customized sample form....now i want to add data thru that form....i dont know where to write code and what is code if i want to add data ??

Please help me
Re: code for Add Button [message #467275 is a reply to message #467267] Fri, 23 July 2010 02:51 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm not sure that I understand what "a customized sample form" is.

However: if this is (one of) your first form(s), you have probably used a data block wizard to create it. If not, perhaps you should have. Wizard creates a form in a few steps. Once it is done, the form is fully functional and makes it possible to query existing records, update them or add a new record. In other words: you don't have to write a single line of code!

Now: what did you do?
Re: code for Add Button [message #467277 is a reply to message #467275] Fri, 23 July 2010 03:06 Go to previous messageGo to next message
swapnil_naik
Messages: 269
Registered: December 2009
Location: Mumbai
Senior Member

hi,

By using wizards, i created a form..its fantastics !!!!1

But now without using wizards, i want created a form....
  • Attachment: sample.fmb
    (Size: 48.00KB, Downloaded 1035 times)
Re: How to write query For ADD Button [message #467286 is a reply to message #467267] Fri, 23 July 2010 03:34 Go to previous messageGo to next message
dhinendra
Messages: 58
Registered: September 2009
Location: Gurgaon,India
Member
hi swapnil
you can use create_record; on add button or you can do like this-
begin
insert into emp
(empno,ename,job,sal)
values(:block16.text_item26,:block16.text_item27,:block16.text_item28,:block16.text_item29);
end;
commit;


Regards:
Dhinendra Panwar
Re: How to write query For ADD Button [message #467308 is a reply to message #467286] Fri, 23 July 2010 04:37 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Huh, no - that might be wrong. Because, commit would save a record that is visible in the form, plus another one with the INSERT statement.


swapnil_naik
But now without using wizards, i want created a form....

OK, but - why on earth would you want to do that? Creating a (default) data block is a tedious job. If there are just a few columns in a table, you'll get bored at the third item. Imagine a form with 20-30 or even more items!

I'd suggest you to use a wizard whenever possible. If you want to rearrange items (after all, that is almost "obligatory" as wizard doesn't pay much attention to aesthetic) or add some logic, do so.
Re: How to write query For ADD Button [message #467309 is a reply to message #467308] Fri, 23 July 2010 05:01 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
I never create blocks without the wizard unless I need one that isn't based on a database object.
And I don't see any point to the add button.
Create a block based on the table.
Enter data into the fields.
Click on save.
Job done.
Re: How to write query For ADD Button [message #467321 is a reply to message #467267] Fri, 23 July 2010 05:51 Go to previous messageGo to next message
dhinendra
Messages: 58
Registered: September 2009
Location: Gurgaon,India
Member
hi
I am sending you the modified fmb.please have a look at it.



Regards:
Dhinendra Panwar
  • Attachment: sample1.fmb
    (Size: 52.00KB, Downloaded 1040 times)
Re: How to write query For ADD Button [message #467325 is a reply to message #467321] Fri, 23 July 2010 06:06 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I can't open the form properly using my 10g Forms builder (ver. 9.0.4).

What should we look at, exactly?
Re: How to write query For ADD Button [message #467329 is a reply to message #467267] Fri, 23 July 2010 06:58 Go to previous messageGo to next message
dhinendra
Messages: 58
Registered: September 2009
Location: Gurgaon,India
Member
Quote:
Huh, no - that might be wrong. Because, commit would save a record that is visible in the form, plus another one with the INSERT statement.


I just send this fmb so as to confirm that it is working correct after writing the same code i mentioned above.



Regards:
Dhinendra Panwar
Re: How to write query For ADD Button [message #467618 is a reply to message #467286] Mon, 26 July 2010 05:00 Go to previous message
fahady
Messages: 8
Registered: July 2010
Location: sindh
Junior Member
pls give example in 6 i form because i seen your query that u given in your message but it cannot execute there might some errors occur
please send your example with form oracle 6i
Previous Topic: Dynamic SQL Statement
Next Topic: can we pass the data again to calling form?
Goto Forum:
  


Current Time: Thu Sep 19 16:29:08 CDT 2024