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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CREATE_RECORD built-in<br />

Description<br />

Creates a new record in the current block after the current record. <strong>Form</strong> <strong>Builder</strong> then navigates to the<br />

new record.<br />

Syntax<br />

PROCEDURE CREATE_RECORD;<br />

Built-in Type restricted procedure<br />

Enter Query Mode no<br />

Parameters<br />

none<br />

CREATE_RECORD examples<br />

/*<br />

** Built-in: CREATE_RECORD<br />

** Example: Populate new records in a block based on return<br />

** values from a query<br />

*/<br />

PROCEDURE Populate_Rows_Into_Block( projid NUMBER) IS<br />

CURSOR tempcur( cp_projid NUMBER ) IS<br />

SELECT milestone_name, due_date<br />

FROM milestone<br />

WHERE project_id = cp_projid<br />

ORDER BY due_date;<br />

BEGIN<br />

/* Add these records to the bottom of the block */<br />

Last_Record;<br />

/* Loop thru the records in the cursor */<br />

FOR rec IN tempcur( projid ) LOOP<br />

/*<br />

** Create an empty record and set the current row’s<br />

** Milestone_Name and Due_Date items.<br />

*/<br />

Create_Record;<br />

: Milestone.Milestone_Name := rec.milestone_name;<br />

: Milestone.Due_Date := rec.due_date;<br />

END LOOP;<br />

First_Record;<br />

END;<br />

65

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

Saved successfully!

Ooh no, something went wrong!