Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Oracle Forms: Oracle Server features


Published on

Oracle Forms: Oracle forms Server features

Published in: Software
  • Be the first to comment

  • Be the first to like this

Oracle Forms: Oracle Server features

  1. 1. Using Oracle Server Features In Forms
  2. 2. Objectives • Use Oracle server functionalities in forms • Deal with server-side PL/SQL • Recognize which PL/SQL8 features are supported in forms • Handle Oracle server errors • Perform DDL commands by using the FORMS_DDL built in subprograms
  3. 3. Oracle Server Features Useful Oracle server features: • Declarative constraints • Stored program units • Database triggers • DDL
  4. 4. Dealing with PL/SQL Code • Where to store PL/SQL code: – On the Oracle server – In the attached PL/SQL libraries – In the form itself • Where to call PL/SQL code: – From database triggers – From forms triggers • Application partitioning
  5. 5. PL/SQL8 Support in Forms • Client-side program units cannot support Oracle8i object-related functionality. • Stored program units can use PL/SQL8 features.
  7. 7. Unsupported Client-side PL/SQL Features • Untrusted external procedures • Object types • Collection types • LOB types • Methods • Objects as stored procedure parameters
  8. 8. Causes for Oracle Server Errors Base Table Block Implicit DML Trigger/PU Explicit DML Stored PU call Form Oracle Server Declarative Constraints Database Triggers Program Units
  9. 9. Trapping Server Errors Base table block On-Error: DBMS_ERROR_CODE DBMS_ERROR_TEXT Explicit DML/PU call When Others: SQLCODE SQLERRM Constraint DB trigger Stored PU Form Oracle Server Predefined message RAISE_APPLICATION_ ERROR RAISE_APPLICATION_ ERROR
  10. 10. FORMS_DDL Built-in • Syntax: FORMS_DDL (statement); • Parameter must be<=32K • Can pass PL/SQL block, DML or DDL statement • Characteristics: – Unrestricted; valid in Enter Query mode – Statement must not contain bind- variable references
  11. 11. FORMS_DDL Built-in • Characteristics: – Statement cannot return results directly – Use FORM_SUCCESS to check success of statement • Hints: – Create SQL Query record group instead of FORMS_DDL for better performance. – Call stored program unit instead of FORMS_DDL
  12. 12. FORMS_DDL Example Example 1: Create a table FORMS_DDL(‘CREATE TABLE t (x number(5))’); IF not FORM_SUCCESS THEN MESSAGE(‘Table creation Failed…’); END IF; Example: 2: Execute Procedure with given name: FORMS_DDL (‘BEGIN ‘ || p_name ||‘; END; ‘); IF not FORM_SUCCESS THEN message(DBMS_ERROR_CODE||’ ‘|| DBMS_ERROR_TEXT); END IF;
  13. 13. Summary • Identify Oracle server features useful for Form Builder • Identify PL/SQL8 supported features • Write PL/SQL code to trap errors raised by the Oracle server – Implicit DML – Explicit DML or stored program units • Perform DDL with FORMS_DDL