0% found this document useful (0 votes)
73 views

Form Built

The document describes various Form Builder built-in functions including: 1. CLEAR_FORM clears all records from the current form. 2. COMMIT_FORM updates data in the database to match the form and performs validation. 3. FORM_SUCCESS, FORM_FAILURE, and FORM_FATAL return the outcome of the most recently executed built-in to determine further processing.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

Form Built

The document describes various Form Builder built-in functions including: 1. CLEAR_FORM clears all records from the current form. 2. COMMIT_FORM updates data in the database to match the form and performs validation. 3. FORM_SUCCESS, FORM_FAILURE, and FORM_FATAL return the outcome of the most recently executed built-in to determine further processing.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Form Built - ins

1.CLEAR_FORM Causes Form Builder to remove all records from, or flush, the current form, and puts the input focus in the first item of the first block. 2.COMMIT_FORM Causes Form Builder to update data in the database to match data in the form. Form Builder first validates the form, then, for each block in the form, deletes, inserts, and updates to the database, and performs a database commit. As a result of the database commit, the database releases all row and table locks. 3.DEBUG_MODE Toggles debug mode on and off in a menu. When debug mode is on in a menu, Form Builder issues an appropriate message when a menu item command executes. 4. ENTER Validates data in the current validation unit. (The default validation unit is Item.) 5.ERASE Removes an indicated global variable, so that it no longer exists, and releases the memory associated with the global variable. Global always allocate 255 bytes of storage. To ensure that performance is not impacted more than necessary, always erase any global variable when it is no longer needs 6. EXECUTE_TRIGGER EXECUTE_TRIGGER executes an indicated trigger. 7. EXIT_FORM Provides a means to exit a form, confirming commits and specifying rollback action. 8.FIND_FORM Searches the list of forms and returns a form module ID when it finds a valid form with the given name. You must define an appropriately typed variable to accept the return value. Define the variable with a type of Form module. 9. FORM_FAILURE Returns a value that indicates the outcome of the action most recently performed during the current Runform session.

Use FORM_FAILURE to test the outcome of a builtin to determine further processing within any trigger. To get the correct results, you must perform the test immediately after the action executes. That is,another action should not occur prior to the test. Example: /* ** Builtin: FORM_FAILURE ** Example: Determine if the most recently executed builtin ** failed. */ BEGIN GO_BLOCK(Success_Factor); /* ** If some validation failed and prevented us from leaving ** the current block, then stop executing this trigger. ** ** Generally it is recommended to test ** IF NOT Form_Success THEN ... ** Rather than explicitly testing for FORM_FAILURE */ IF Form_Failure THEN RAISE Form_Trigger_Failure; END IF; END; 10.FORM_FATAL Returns the outcome of the action most recently performed during the current Runform session. Use FORM_FATAL to test the outcome of a builtin to determine further processing within any trigger. To get the correct results, you must perform the test immediately after the action executes. That is, another action should not occur prior to the test. Example:

/* ** Builtin: FORM_FATAL ** Example: Check whether the mostrecently executed builtin had a fatal error.*/ BEGIN

User_Exit(Calculate_Line_Integral control.start control.stop); /* ** If the user exit code returned a fatal error, print a ** message and stop executing this trigger.

** ** Generally it is recommended to test ** ** IF NOT FORM_SUCCESS THEN ... ** ** Rather than explicitly testing for FORM_FATAL IF Form_Fatal THEN Message(Cannot calculate the Line Integral due to internal error.); RAISE Form_Trigger_Failure; END IF; END; 11.FORM_SUCCESS Returns the outcome of the action most recently performed during the current Runform session. Use FORM_SUCCESS to test the outcome of a builtin to determine further processing within any trigger. To get the correct results, you must perform the test immediately after the action executes. That is, another action should not occur prior to the test. Note: FORM_SUCCESS should not be used to test whether a COMMIT_FORM or POST builtin has succeeded. Because COMMIT_FORM may cause many other triggers to fire, when you evaluate FORM_SUCCESS it may not reflect the status of COMMIT_FORM but of some other, more recently executed builtin. A more accurate technique is to check that the SYSTEM.FORM_STATUS variable is set to QUERY after the operation is done. Example: /* ** Builtin: FORM_SUCCESS ** Example: Check whether the mostrecently executed builtin ** succeeded. BEGIN /* ** Force validation to occur*/ Enter; /* ** If the validation succeeded, then Commit the data. ** */ IF Form_Success THEN Commit; IF :System.Form_Status <> QUERY THEN Message(Error prevented Commit); RAISE Form_Trigger_Failure; END IF; END IF;

END; 12.FORMS_DDL FORMS_DDL( statement) Issues dynamic SQL statements at runtime, including serverside PL/SQL and DDL. Note: All DDL operations issue an implicit COMMIT and will end the current transaction without allowing Oracle Forms to process any pending changes. If you use FORMS_DDL to execute a valid PL/SQL block: a)Use semicolons where appropriate. b)Enclose the PL/SQL block in a valid BEGIN/END block structure. c)Do not end the PL/SQL block with a slash. d)Line breaks, while permitted, are not required. Example 1: If you use FORMS_DDL to execute a single DML or DDL statement: /* ** Builtin: FORMS_DDL ** Example: The expression can be a string literal.*/ BEGIN Forms_DDL(create table temp(n NUMBER)); IF NOT Form_Success THEN Message (Table Creation Failed); ELSE Message (Table Created); END IF; END; Example 2: /* ** Builtin: FORMS_DDL ** Example: The string can be an expression or variable. ** Create a table with n Number columns. ** TEMP(COL1, COL2, ..., COLn). */ PROCEDURE Create_N_Column_Number_Table (n NUMBER) IS my_stmt VARCHAR2(2000); BEGIN my_stmt := create table tmp(COL1 NUMBER; FOR I in 2..N LOOP

my_stmt := my_stmt,COLTO_CHAR(i) NUMBER; END LOOP; my_stmt := my_stmt); /* ** Now, create the table... */ Forms_DDL(my_stmt); IF NOT Form_Success THEN Message (Table Creation Failed); ELSE Message (Table Created); END IF; END; 13.GET_FORM_PROPERTY Returns information about the given form. If your application is a multi-form application, then you can call this built-in to return information about the calling form, as well as about the current, or called form. 14.ID_NULL Returns a BOOLEAN value that indicates whether the object ID is available. 15.NEW_FORM Exits the current form and enters the indicated form. The calling form is terminated as the parent form. If the calling form had been called by a higher form, Oracle Forms keeps the higher call active and treats it as a call to the new form. Oracle Forms releases memory (such as database cursors) that the terminated form was using. Oracle Forms runs the new form with the same Runform options as the parent form. If the parent form was a called form, Oracle Forms runs the new form with the same options as the parent form. NEW_FORM (formmodule_name VARCHAR2, rollback_mode, query_mode, data_mode, paramlist_name ) Parameters: a).Formmodule_name Specifies the formmodule name of the called form. The name must be enclosed in single quotes. The data type of the name is CHAR. b).rollback_mode TO_SAVEPOINT Oracle Forms rolls back all uncommitted changes (including posted changes) to the current forms savepoint. NO_ROLLBACK: Oracle Forms exits the current form without rolling back to a savepoint. You can leave the top level form without performing a rollback, which means that you retain any

locks across a NEW_FORM operation. These locks can also occur when invoking Oracle Forms from an external 3GL program. The locks are still in effect when you regain control from Oracle Forms. FULL_ROLLBACK: Oracle Forms rolls back all uncommitted changes (including posted changes) that were made during the current Runform session. You cannot specify a FULL_ROLLBACK from a form that is running in postonly mode. (Postonly mode can occur when your form issues a call to another form while unposted records exist in the calling form. To avoid losing the locks issued by the calling form, Oracle Forms prevents any commit processing in the called form.) c).Query_Mode Takes one of the following constants as an argument: NO_QUERY_ONLY: Runs the indicated form normally, allowing the operator to perform inserts, updates, and deletes in the form. QUERY_ONLY: Runs the indicated form as a queryonly form. d).Paramlist_Id Specifies the unique ID Oracle Forms assigns when it creates the parameter list. Specify a parameter list when you want to pass parameters from the calling form to the new form. The data type of the ID is PARAMLIST. A parameter list passed to a form via NEW_FORM cannot contain parameters of type DATA_PARAMETER (a pointer to record group). paramlist_name:The name you gave the parameter list object when you defined it. The data type of the name is CHAR. A parameter list passed to a form via NEW_FORM cannot contain parameters of type DATA_PARAMETER (a pointer to record group). 16.CALL_FORM. Runs an indicated form while keeping the parent form active. Oracle Forms runs the called form with the same Runform preferences as the parent form. When the called form is exited Oracle Forms processing resumes in the calling form at the point from which you initiated the call to CALL_FORM. CALL_FORM (formmodule_name VARCHAR2, display NUMBER, switch_menu NUMBER, query_mode NUMBER, data_mode NUMBER, paramlist_name VARCHAR2); Parameters: a).formmodule_name Specifies the formmodule name of the called form. The name must be enclosed in single quotes. The data type of the name is CHAR. b).display Specify one of the following constants as an argument:

HIDE: Causes Oracle Forms to clear the calling form from the screen before drawing the called form. HIDE is the default parameter. NO_HIDE: Causes Oracle Forms to display the called form without clearing the calling form from the screen. c).switch_menu Takes one of the following constants as an argument: NO_REPLACE Causes Oracle Forms to keep the default menu application of the calling form active for the called form. DO_REPLACE Causes Oracle Forms to replace the default menu application of the calling form with the default menu application of the called form. d).query_mode Takes one of the following constants as an argument: NO_QUERY_ONLY: Causes Oracle Forms to run the indicated form in normal mode, allowing the operator to perform inserts, updates, and deletes from within the called form. QUERY_ONLY: Causes Oracle Forms to run the indicated form in Query Only mode, allowing the operator to query, but not to insert, update, or delete records. e).paramlist_id Specifies the unique ID Oracle Forms assigns when it creates the parameter list. You can optionally include a parameter list as initial input to the called form. The data type of the ID is PARAMLIST. paramlist_name: The name you gave the parameter list object when you defined it. The data type of the name is CHAR. Call_Form(lookcust,NO_HIDE,DO_REPLACE,QUERY_ONLY); 17.OPEN_FORM Opens the indicated form. Call OPEN_FORM to create multipleform applications, that is, applications that open more than one form at the same time. OPEN_FORM (form_name VARCHAR2, activate_mode NUMBER, session_mode NUMBER, data_mode NUMBER, paramlist_id PARAMLIST); a).form_name pecifies the CHAR name of the form to open.

b).activate_mode ACTIVATE: Sets focus to the form to make it the active form in the application. NO_ACTIVATE: Opens the form but does not set focus to the form. The current form remains current. c).session_mode NO_SESSION: Specifies that the opened form should share the same database session as the current form. A COMMIT operation in any form will cause validation and commit processing to occur for all forms running in the same session. SESSION: Specifies that a new, separate database session should be created for the opened form. d).paramlist_name Specifies the CHAR name of a parameter list to be passed to the opened form. paramlist_id: Specifies the unique ID that Oracle Forms assigns to the parameter list at the time it is created. Use the GET_PARAMETER_LIST function to return the ID to a variable of type PARAMLIST. OPEN_FORM( OPEN_FORM( OPEN_FORM( OPEN_FORM( OPEN_FORM( form_name); form_name,activate_mode); form_name,activate_mode,session_mode); form_name,activate_mode,session_mode,paramlist_name); form_name,activate_mode,session_mode,paramlist_id);

18.REPLACE_MENU Replaces the current menu with the specified menu, but does not make the new menu active. REPLACE_MENU also allows you to change the way the menu displays and the role. 19.SET_FORM_PROPERTY Sets a property of the given form. Syntax: SET_FORM_PROPERTY( formmodule_id, property, value); SET_FORM_PROPERTY( formmodule_name, property, value); 20.GET_APPLICATION_PROPERTY Description: The GET_APPLICATION_PROPERTY builtin returns information about the current Oracle Forms application. You must call this builtin once for each value you want to retrieve. tm_name := Get_Application_Property(TIMER_NAME);

Example 2: /* ** Builtin: GET_APPLICATION_PROPERTY ** Example: Capture the username and password of the ** currently loggedon user, for use in calling ** another Tool. */ PROCEDURE Get_Connect_Info( the_username IN OUT VARCHAR2, the_password IN OUT VARCHAR2, the_connect IN OUT VARCHAR2) IS BEGIN the_username := Get_Application_Property(USERNAME); the_password := Get_Application_Property(PASSWORD); the_connect := Get_Application_Property(CONNECT_STRING); END; Posted by Amirtharaj K at 9:29 AM

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy