?
Solved

Oracle Forms 6i: Delete Record Method

Posted on 2003-11-03
6
Medium Priority
?
8,951 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 Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
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 how to recover a database from a user managed backup
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

765 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