Re: Forms4.5 -- changing record status

From: nix <nix_at_gate.net>
Date: 1996/01/11
Message-ID: <30F499BE.4A91_at_gate.net>#1/1


Let me explain a little how forms works.

   When you create a block based on a database table Oracle Forms manages all selects, updates, inserts and delete. Thus it knows when a record is queried, changed, new or deleted. It only knows this if IT queried the records. How does it know that, because it also queries the rowid. You can verify this by trying to access :blockname.rowid in a form.

   Now it you don't let Forms EXECUTE_theQUERY then you must also set the rowid column so that when you try to set the RECORD status to CHANGED the rowid is not null and Forms know what record to update.

If a record does not have a rowid then it can not be status CHANGED.

In my opinion, there are VERY FEW reasons to do what you are doing.

Why do you feel that you need to populate the block from a procedure rather than letting forms do it?

Janice Powell wrote:
>
> First of all, thanks SO MUCH for the help I've gotten from several
> users concerning questions I've submitted to this NewsGroup. Your
> input has greatly helped!
>
> I have exhausted all the resources I have in solving this problem
> and still can't get my form to work correctly.
> In my Form, I populate a block via a procedure rather than just
> issuing an EXECUTE_QUERY command. I'm running into a problem where the
> record associated with the block is set to INSERT rather than CHANGED
> no matter if data was successfully queried. It is initially set to NEW
> then after I populate the items, it is changed to INSERT by Forms.
> Thus, each time I do a COMMIT, the data is being inserted into the
> table.
> I added a set_record_property statement to the procedure to change
> the status to CHANGED rather than INSERT, but I got a FRM-40742 error.
> Forms4.5 Ref. Manual (Vol. 1) notes that as an illegal status change.
> So I tried to accomplish an update through another angle. I knew
> Forms4.5 would always try to INSERT the data in the table. So,I set a
> global variable in my procedure to = 'UPDATE' if data was sucessfully
> queried from the database. Then I created an ON-INSERT trigger that
> checked this global variable. If it was not = 'UPDATE', I executed an
> INSERT_RECORD statement; else, I executed an
> execute_trigger('on-update') statement. And in that trigger I executed
> an UPDATE_RECORD statement. I didn't get an error, but my record also
> did not get updated.
>
> Has anyone ever tried to do this? If so, how did you get it to work.
> Also, when does Forms4.5 initally set the record status?
>
> Please send replies to this news group and/or my e-mail address of
> powell_at_clemson.edu.
>
> Any info would be greatly appreciated.
> --JP
>
> Janice Powell
> Programmer Analyst
> Clemson Univ.
> Clemson, SC
 

-- 
______________________
Robert C. nix_at_gate.net
Received on Thu Jan 11 1996 - 00:00:00 CET

Original text of this message