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.

FORMS_DDL built-in<br />

Description<br />

Issues dynamic SQL statements at runtime, including server-side PL/SQL and DDL.<br />

Note: All DDL operations issue an implicit COMMIT and will end the current transaction without<br />

allowing <strong>Form</strong> <strong>Builder</strong> to process any pending changes.<br />

Syntax<br />

FUNCTION FORMS_DDL<br />

(statement VARCHAR2);<br />

Built-in Type unrestricted function<br />

Enter Query Mode yes<br />

Parameters<br />

statement Any string expression up to 32K:<br />

a literal<br />

an expression or a variable representing the text of a block of<br />

dynamically created PL/SQL code<br />

a DML statement or<br />

a DDL statement<br />

Usage Notes<br />

Commit (or roll back) all pending changes before you issue the FORMS_DDL command. All DDL<br />

operations issue an implicit COMMIT and will end the current transaction without allowing <strong>Form</strong><br />

<strong>Builder</strong> to process any pending changes, as well as losing any locks <strong>Form</strong> <strong>Builder</strong> may have acquired.<br />

Some supplied stored procedures issue COMMIT or ROLLBACK commands as part of their logic.<br />

Make sure all pending changes in the form are committed or rolled back before you call those built-ins.<br />

Use the SYSTEM.FORM_STATUS variable to check whether there are pending changes in the current<br />

form before you issue the FORMS_DDL command. (See Example 4.)<br />

If you use FORMS_DDL to execute a valid PL/SQL block:<br />

• Use semicolons where appropriate.<br />

• Enclose the PL/SQL block in a valid BEGIN/END block structure.<br />

• Do not end the PL/SQL block with a slash.<br />

• Line breaks, while permitted, are not required.<br />

If you use FORMS_DDL to execute a single DML or DDL statement:<br />

• Omit the trailing semicolon to avoid an invalid character error.<br />

To check whether the statement issued using FORMS_DDL executed correctly, use the<br />

FORM_SUCCESS or FORM_FAILURE Boolean functions. If the statement did not execute correctly,<br />

check the error code and error text using DBMS_ERROR_CODE and DBMS_ERROR_TEXT. Note<br />

that the values of DBMS_ERROR_CODE and DBMS_ERROR_TEXT are not automatically reset<br />

150

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

Saved successfully!

Ooh no, something went wrong!