11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DUPLICATE_RECORD built-in<br />

Description<br />

Copies the value of each item in the record with the next lower sequence number to the corresponding<br />

items in the current record. The current record must not correspond to a row in the database. If it does,<br />

an error occurs.<br />

Note: The duplicate record does not inherit the record status of the source record; instead, its record<br />

status is INSERT.<br />

Syntax<br />

PROCEDURE DUPLICATE_RECORD;<br />

Built-in Type restricted procedure<br />

Enter Query Mode no<br />

Parameters<br />

none<br />

DUPLICATE_RECORD restrictions<br />

A previous record must exist in your current session.<br />

DUPLICATE_RECORD examples<br />

/*<br />

** Built-in: DUPLICATE_RECORD;<br />

** Example: Make a copy of the current record and increment<br />

** the "line_sequence" item by one.<br />

*/<br />

DECLARE<br />

n NUMBER;<br />

BEGIN<br />

/*<br />

** Remember the value of the ’line_sequence’ from the<br />

** current record<br />

*/<br />

n := :my_block.line_sequence;<br />

/*<br />

** Create a new record, and copy all the values from the<br />

** previous record into it.<br />

*/<br />

Create_Record;<br />

Duplicate_Record;<br />

/*<br />

** Set the new record’s ’line_sequence’ to one more than<br />

** the last record’s.<br />

*/<br />

:my_block.line_sequence := n + 1;<br />

END;<br />

99

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!