Re: INSERT INTO and MULTI-RECORD Pls Help!

From: Matt B. <mcb_at_fightspam.sd.znet.com>
Date: 2000/06/12
Message-ID: <skb5jt47h51169_at_corp.supernews.com>#1/1


<times9_at_my-deja.com> wrote in message news:8i388n$ejr$1_at_nnrp1.deja.com...
>I'm new to Oracle Forms, and I'd appreciate the help. I created a temporary
table, and I'm trying to insert a record into this temporary table when a user clicks on a button. The table isn't a block in forms if that makes any difference.

Not directly.

>But when I click on that button which has the INSERT INTO statement in it's
WHEN-BUTTON-PRESSED trigger, and then I check the temporary table, nothing is present in the table.

You won't see the data in another session until after you issue a commit and it commits successfully.

> Am I not allowed to call INSERT INTO statements within oracle forms?

You can.

>If so, how can I get around it.

Put a commit after your insert statement. The only thing I'm not sure of offhand is that since your block isn't a database block and you're inserting manually, it might depend on any other data in your form corresponding to a database table and the record status of at least one record being INSERT or CHANGED. Even though you explicitly inserted into a table, I'm not sure if forms will commit it if nothing else has changed or not (might get a "No changes to commit" message at runtime even though you manually inserted a row). You might need to make something a database block or manipulate the record status of something (tricky and kinda restrictive).

>I would also like to know how I can insert records into a multi-record block.
I know that in a master-detail relation, the multi-record block gets populated, but is there a way to do it manually?

POST-QUERY of the block fires once for every row returned from the database for that block but before control is returned to the user. Does that sound like what you might want?

Or, you might be able to set the block's deferred property to TRUE (YES) and auto-query = FALSE (NO), do the stuff you wanna do on WHEN-NEW-BLOCK-INSTANCE, and then manually do an EXECUTE_QUERY or a DO_KEY('EXECUTE-QUERY') (look up do_key in the help for the syntax and use of it). However that EXECUTE_QUERY will attempt to clear the block, so that might trample what you're trying to do.

>If I wanted to insert something specifically myself -- how would I do this?
For example, how would I intercept the detail being populated, so that I can do some processing on the records being displayed on the detail section before it is displayed.

Hmmm...sounds like POST-QUERY is what you want.

>And to sort out which detail record to show and which ones not to show. How do
I index the individual records of the multi-record block?

[Quoted] Do you just wanna throw out certain records based on a query? How about [Quoted] setting the default where-clause of the block then?

Or you can evaluate the record when it comes back and do a CLEAR_RECORD?

[Quoted] (I guess I need to know more specifics of what you're trying to do. Can you [Quoted] give us an example?)

-Matt Received on Mon Jun 12 2000 - 00:00:00 CEST

Original text of this message