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
Solved

Oracle Forms 6i: Delete Record Method

Posted on 2003-11-03
6
8,179 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
  • 3
  • 2
6 Comments
 
LVL 15

Accepted Solution

by:
andrewst earned 500 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

837 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