how to insert records manually [message #594560] |
Fri, 30 August 2013 02:22 |
|
newbieinapps
Messages: 13 Registered: August 2013
|
Junior Member |
|
|
I have a form with a datablock displaying 3 text item fields.
But the actual oracle table have 8 columns.
When ever I insert new data and save it, only the three records are being stored in backend whereas remaining column stores with null value.
That is the basic function of the form.
I placed an another list item field in a control block which is non-database item.
Now I want to store the list item value into a column along with the 3 columns.
In a simple way, how to insert record manually along with the other records?
|
|
|
Re: how to insert records manually [message #594567 is a reply to message #594560] |
Fri, 30 August 2013 03:08 |
cookiemonster
Messages: 13938 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Do you want to insert an additional record, or do you want to include the value from the list item in the records the datablock inserts anyway?
It's not clear from your post what you want to happen.
|
|
|
|
Re: how to insert records manually [message #594574 is a reply to message #594570] |
Fri, 30 August 2013 03:18 |
cookiemonster
Messages: 13938 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Littlefoot wrote on Fri, 30 August 2013 09:11
Or, you could try with POST-INSERT trigger and manually (in a loop through all records of the database block) perform UPDATE of the base table.
I haven't forms handy to check but I'm pretty sure go_record is illegal in post-insert.
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: how to insert records manually [message #594790 is a reply to message #594785] |
Tue, 03 September 2013 03:53 |
cookiemonster
Messages: 13938 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
You should do what LF suggested in the first place:
Quote:
Although your data block contains 3 items, I'd suggest you to add the fourth one (which can be hidden if you don't want to see it, but it must be a database item). It would contain value of the non-database list item.
Two options I can think of: one is to use "copy value from item" property for the fourth data block item (you'd copy non-database list item's value into it). Or, in a PRE-INSERT trigger, put non-database list item's value into the fourth item of the database block.
That will make the automatic insert work properly. No manual insert needed. No manual query needed.
|
|
|