Re: deleting records prior to entering a form

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1997/06/04
Message-ID: <5n2lq5$mua_at_info.csufresno.edu>#1/1


In article <5n2abu$eko$1_at_mark.ucdavis.edu>, george <wgweis_at_ucdavis.edu> wrote:
>I have this problem I hope someone out there can help me with. I am
>using a temporary table to store text lines for a student transcript.
>Each record in the table is one line of text. Before entering the
>form displaying the transcript, however, I'd like to clean up this
>table by deleting any records which were not created on the actual day
>the form is being run. I wrote the following code in a trigger called
>by WHEN-NEW-FORM-INSTANCE:
>
>/*
> * New trigger: delete old transcript_temp records.
> */
>DECLARE
> TODAY DATE;
>BEGIN
> SELECT SYSDATE INTO TODAY FROM DUAL;
>
> DELETE FROM TEMP_TABLE WHERE TEMP_TABLE_ACTIVITY_DATE <
>TRUNC(TODAY);
<snip>

just add the following line here:

 Forms_DDL(Commit);

>END;
>
>The problem is, the records don't get deleted. It is as if I need to
>commit somewhere and the form is not committing. I tried 'COMMIT'
>instead of 'COMMIT_FORM' with no results. MS Access has something
>called a delete query. How can I do the same thing in Oracle?

Doing a commit_form doesn't work either because you can't in a WNFI trigger, or more likely, that your form doesn't sense any changes having been made.

However, you can do even better than the above method. Why not delete everything from temp_table immediately after displaying the transcript. There is no need for the lines in temp_table once you have retrieved them into your display form. That's what we do.

Regards,
Steve Cosner



Try out QA, a dynamic data utility form. Quick display and update access to any table. http://members.aol.com/stevec5088 Received on Wed Jun 04 1997 - 00:00:00 CEST

Original text of this message