How do you make a form do an update instead of an insert?

From: web guy <web-guy01_at_attbi.com>
Date: Tue, 18 Feb 2003 13:19:36 GMT
Message-ID: <Ipq4a.161888$HN5.691524_at_rwcrnsc51.ops.asp.att.net>



[Quoted] Using 9iAS R2.

A form has a datablock that does new record inserts fine. I want to use the same
block to do record updates.

The data block has several LOV items, which allows the user to search for an entry by
code or by name, however the value that actually gets stored in the record is an ID number
of the entry. This ID is meaningless to the user, so for updating I want to pre-populate the
code and name values based on the ID. I can't do that by changing the DEFAULT_WHERE
property of the block.

So, I wrote a function that queries all the data, joins the necessary tables to get the code and name for
the LOVs, and then I populate the datablock. How do I indicate to the data block that upon COMMIT_FORM
it should do an update, not an insert?

I'm open to suggestions for other ways to handle this.

Thanks,

Tim Received on Tue Feb 18 2003 - 14:19:36 CET

Original text of this message