How to write query For ADD Button [message #467267] |
Fri, 23 July 2010 02:30 |
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: How to write query For ADD Button [message #467286 is a reply to message #467267] |
Fri, 23 July 2010 03:34 |
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 |
|
Littlefoot
Messages: 21823 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_naikBut 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 |
cookiemonster
Messages: 13963 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 #467329 is a reply to message #467267] |
Fri, 23 July 2010 06:58 |
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
|
|
|
|