Solved

Creating duplicate record at the end of the block records

Posted on 2004-05-03
4
622 Views
Last Modified: 2012-06-22
Hi,

I have such a problem.
When pressing duplicate record  need a duplicate record to be created after the last record in the block. The same thing i have to do when pressing insert record.
What should i write in key-duprec trigger?
Thanks.
0
Comment
Question by:sky_lt
4 Comments
 
LVL 34

Accepted Solution

by:
Mark Geerlings earned 50 total points
ID: 10981775
To create a duplicate record, you simply have to put this in the key-duprec trigger:
duplicate_record;

Be aware though, that this is not limited to creating a duplicate "after the last record in the block".  The operator could press this on any record, if the default "insert record" functionality is available.

Do you want that trigger functionality changed also, so the cursor advances to the last record first, then does a "dup-rec"?  If so, then your key-crerec trigger should be:
last_record;
duplicate_record;

I'm curious though, what is significant about the "last" record that should be duplicated rather than another record in the block?  What happens if a user queries only some of the exisiting records in the table, then calls this trigger?  What if two people query all of the records at the same time, then they each call this trigger?  Must the form (or the user) modify this duplicated record before it gets saved?  If not, are you saying the table allows duplicates?
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.

Join & Write a Comment

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now