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

From: Jeff <jeff_at_work.com>
Date: Wed, 19 Feb 2003 13:26:50 GMT
Message-ID: <b300mq$f9$1_at_cronkite.cc.uga.edu>


This is confusing and I may be misunderstanding what you're after, but I think what you want is to create non-database items in the datablock and fill them during a post-query trigger. For example, if instead of displaying an employee number you want to display his name from another table, in the post-query trigger select into :datablock.ename, a non-database text item, from emp where emp.empno = :datablock.empno. You get the idea.

In article <Ipq4a.161888$HN5.691524_at_rwcrnsc51.ops.asp.att.net>, "web guy" <web-guy01_at_attbi.com> wrote:
>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 Wed Feb 19 2003 - 14:26:50 CET

Original text of this message