Re: FRM-40501
Date: 20 Jul 2002 07:18:04 GMT
Message-ID: <3d390eac$1_at_usenetgateway.com>
sometimes this error is generated when oracle forms does not understand
how to correctly identify unique rows in the database based on its
block. For example, create a view that does some joins. Then use the
view as the basis of a block. The view will likely have instead of
triggers to remap the dml logic correctly. If you insert a row into the
view via a normal block insert, and then try to update/delete it
immediately after commiting but without re-querying the block, you can
get this error. This is because the form is confused about how to use
ROWID to find the new row in the database. There are at least 2
solutions:
1) re-query the block after any insert operation
2) don't use ROWID as the key method for the block. This is my preferred
method (I don't like being forced to requery and I always use single column numbers from a sequence for all my table's primary keys so this works well). To do this you need to do two things: a) identify the column(s) in your block that are your tables primary key by setting item property "primary key" to yes, b) set the blocks "key mode" propety to one of either non-updateable or updateable (read the forms help to find out what this means). In short this makes the block use your tables Primary key and not ROWID, when finding rows to update/delete. Thus you don't have a problem finding the row and won't get this (and related) errors. Ofcourse, you can't do this if your primary key has columns that accept nulls so make sure your relational design is a good one.
Good luck
-- Posted via dBforums http://dbforums.comReceived on Sat Jul 20 2002 - 09:18:04 CEST