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.

query string contains bind variable references which are local to A (:block.item or<br />

:PARAMETER.param), when form A terminates execution, the global query record group is<br />

converted to a global non-query record group (it retains the data, but a subsequent call to<br />

POPULATE_GROUP is considered an error).<br />

CREATE_GROUP_FROM_QUERY examples<br />

/*<br />

** Built-in: CREATE_GROUP_FROM_QUERY<br />

** Example: Create a record group from a query, and populate<br />

it.<br />

*/<br />

DECLARE<br />

rg_name VARCHAR2(40) := ’Salary_Range’;<br />

rg_id RecordGroup;<br />

errcode NUMBER;<br />

BEGIN<br />

/*<br />

** Make sure group doesn’t already exist<br />

*/<br />

rg_id := Find_Group( rg_name );<br />

/*<br />

** If it does not exist, create it and add the two<br />

** necessary columns to it.<br />

*/<br />

IF Id_Null(rg_id) THEN<br />

rg_id := Create_Group_From_Query( rg_name,<br />

’SELECT SAL-MOD(SAL,1000) BASE_SAL_RANGE,’<br />

||’COUNT(EMPNO) EMPS_IN_RANGE ’<br />

||’FROM EMP ’<br />

||’GROUP BY SAL-MOD(SAL,1000) ’<br />

||’ORDER BY 1’);<br />

END IF;<br />

/*<br />

** Populate the record group<br />

*/<br />

errcode := Populate_Group( rg_id );<br />

END;<br />

59

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

Saved successfully!

Ooh no, something went wrong!