A script-enabled browser is required for this page to function properly.

DUPLICATE_RECORD Built-in

Description

Copies the value of each item in the record with the next lower sequence number to the corresponding items in the current record. The current record must not correspond to a row in the database. If it does, an error occurs.

Note: The duplicate record does not inherit the record status of the source record; instead, its record status is INSERT.

Syntax

PROCEDURE DUPLICATE_RECORD;

Built-in Type restricted procedure

Enter Query Mode no

Parameters

None.

DUPLICATE_RECORD Restrictions

A previous record must exist in your current session.

DUPLICATE_RECORD Examples

/*

** Built-in: DUPLICATE_RECORD;
** Example: Make a copy of the current record and increment
** the "line_sequence" item by one.
*/
DECLARE
n NUMBER;
BEGIN
/*
** Remember the value of the 'line_sequence' from the
** current record
*/
n := :my_block.line_sequence;
/*
** Create a new record, and copy all the values from the
** previous record into it.
*/
Create_Record;
Duplicate_Record;
/*
** Set the new record's 'line_sequence' to one more than
** the last record's.
*/
:my_block.line_sequence := n + 1;
END;