[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Oracle Forms 6i: Delete Record Method

Posted on 2003-11-03
6
Medium Priority
?
9,190 Views
Last Modified: 2009-11-25
I have a form that contains records from a table.  The records are displayed:

   field x             field y            field z
   data x             data y            data z
   data x2           data y2           data z2
   ...

I want to give the user the ability to delete one or more records on the table.  I have done this on other database form systems by putting a "check box" in front of each record.  If the user wants the record deleted, they select the checkbox.  When they hit the "Save" button, the application removes all records where the checkbox has been checked.

Any ideas on how to do this or something similar??
0
Comment
Question by:DCCoolBreeze
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 15

Accepted Solution

by:
andrewst earned 2000 total points
ID: 9671950
You can do that.  Add the checkbox as a non-base-table item.  Then in the KEY-COMMIT trigger you can navigate through the records and delete the checked ones like this:

GO_RECORD(1);
LOOP
  IF :block.delete_flag = 'Y' THEN
    DELETE_RECORD;
  END IF;
  EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
  NEXT RECORD;
END LOOP;
COMMIT_FORM;
0
 
LVL 1

Author Comment

by:DCCoolBreeze
ID: 9672200
OK.  Great.  How do I get the checkbox to display one checkbox for each record in the form?
0
 
LVL 15

Expert Comment

by:andrewst
ID: 9672313
Put the checkbox in the same block as the records, and with property Number of Item Displayed = 0
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 1

Author Comment

by:DCCoolBreeze
ID: 9672387
Got error:

FRM-30174: Checked and Unchecked check box values must be distinct.
Check Box CHK_DELETE
Item: CHK_DELETE
Block: NX_AP_VAD_UNITS_OF_MEASURE
Form: NX_UOM
FRM-30085: Unable to adjust form for output.

0
 
LVL 15

Expert Comment

by:andrewst
ID: 9672483
When you define a checkbox item you must populate these properties with distinct values:

Value when checked
Value when not checked

For example, Y and N, or 1 and 0
0
 
LVL 1

Expert Comment

by:mlbustos
ID: 25910164
PROCEDURE DELREC IS

BEGIN
GO_BLOCK('PSUM_DISTN');
FIRST_RECORD;
LOOP
 IF :block.delete_flag = 'Y' THEN
    DELETE_RECORD;
ELSE
    NEXT_RECORD;
END IF;    

IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
 IF  IF :block.delete_flag = 'Y' THEN
    DELETE_RECORD;
 END IF;
 EXIT;
END IF;
END LOOP;
do_key('commit_form');
 
END;
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question