Fields not writing to database table [message #467741] |
Tue, 27 July 2010 01:15 |
dev_777
Messages: 32 Registered: June 2010
|
Member |
|
|
I have an Oracle Form 6i.
There are two blocks. One is a database block called CUSTOMER and the other is a non-database block called CONTROL.
In the PRE-INSERT trigger of the database block, values from the non-database table block are passed to the database table block.
When I pass values I use the :BLOCK_NAME.field_name eg. :CUSTOMER.scale_code := :CONTROL.scale.
In this form the values passed to the database block from the non-database block in the PRE-INSERT trigger do not use the block name eg:-
:warehouse := :global.default_warehouse;
:capturer :=captured
:scale_code := scale;
:date_captured := sysdate;
insert into dd_audit(cus_id,cap_date) values(:CONTROL.cus_id,SYSDATE);
This application used to work fine for months, last week when writing the values in the PRE-INSERT trigger, just the warehouse field had a value. The remaining fields after the warehouse did not pass any values, although it was verified that values would have been present in the non-database block. The date_captured field should have at least had the system date. The last insert into dd_audit was successful.
I have done numerous tests on our test database and could not replicate the problem. Would passing the values from the non-database block to the database block without the :BLOCK_name preceding the field name cause this problem.
Any idea what could cause this problem after all these months?
[Updated on: Tue, 27 July 2010 01:20] Report message to a moderator
|
|
|
|
|
Re: Fields not writing to database table [message #467746 is a reply to message #467744] |
Tue, 27 July 2010 01:38 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Why didn't you precede item names with block names? I'm not saying that it would help, just being curious. (You know, something like "the best practice says that you should always address items with block and item names").
As this doesn't happen all the time, and you (copy-paste from the first message) use such a notation:
:warehouse := :global.default_warehouse;
:capturer :=captured --> := :captured ? Is a colon missing?
:scale_code := scale; --> := :scale ?
:date_captured := sysdate;
I guess you "forgot" to put colons here (on the forum). If not, what are "captured" and "scale", then? Parameters, perhaps? Functions? If so, where and how do you set them? Perhaps they don't get a value every time (for every record)?
On the other hand, SYSDATE is always valid and returns a value (I can't remember it failed, ever), but - you said that even ":date_captured" was left without a value, while the following INSERT statement did the job.
Looks like a nightmare; it would be easier if it happened for all the records, not just occasionally.
|
|
|
|