Home » Developer & Programmer » Forms » Fields not writing to database table (Forms 6i)
Fields not writing to database table [message #467741] Tue, 27 July 2010 01:15 Go to next message
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 #467742 is a reply to message #467741] Tue, 27 July 2010 01:20 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Interesting. But no idea, except a simple one: did you try to recompile the form (<Ctrl + Shift + K>) and then run it again?
Re: Fields not writing to database table [message #467744 is a reply to message #467742] Tue, 27 July 2010 01:25 Go to previous messageGo to next message
dev_777
Messages: 32
Registered: June 2010
Member
Already did that. It seems to be an intermittent problem. Out of 100 records created about 5 had this problem. If there are network issues(while the user was capturing) I am sure the record would not commit at all.
Re: Fields not writing to database table [message #467746 is a reply to message #467744] Tue, 27 July 2010 01:38 Go to previous messageGo to next message
Littlefoot
Messages: 21818
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.
Re: Fields not writing to database table [message #467750 is a reply to message #467746] Tue, 27 July 2010 01:56 Go to previous message
dev_777
Messages: 32
Registered: June 2010
Member
Oops, sorry, I missed the colons.

This application was written by another developer. I always use :block.field_name.

Going to suggest that we change the application to use :block.field_name and monitor the data.

Thanks, would let you know what happens.

[Updated on: Tue, 27 July 2010 01:57]

Report message to a moderator

Previous Topic: How to create the file in %TEMP% directory?
Next Topic: How to connect Excel with oracle database via form 10g login screen
Goto Forum:
  


Current Time: Thu Sep 19 20:24:55 CDT 2024