Solved

Creating duplicate record at the end of the block records

Posted on 2004-05-03
4
632 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
[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
4 Comments
 
LVL 35

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to recover a database from a user managed backup
Suggested Courses

630 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