The document discusses form builder in Oracle Forms, including creating form modules, data blocks, and different types of items such as text items, buttons, and list items. It also covers topics like triggers, windows, canvases, and how to display forms across multiple windows.
Forms 5.0 FormBuilder Data Blocks, Frames, Text Items and LOV Input and Non-input Items Widows and Canvases Triggers and Functions Flexible code Sharing and Code Multi Form Applications !
2.
Form Builder andCreation of Data Blocks Form Builder Create a form module Create a data block Modify a data block using the data block Wizard Modify the layout using the layout wizard Creating a Master-Detail Form ! !
3.
Form Builder EnvironmentForm Builder executables Components of Form Builder Objects in a Form Module !
4.
Form Builder KeyFeatures With Form Builder you can : Insert, update, delete, query data Present data as text, image etc Control forms across several windows Access graphics and OLE2 applications Use integrated menus Send data to Report Builder ! @
Data Blocks AB C D X Y Z A B C A B C Master Data Block Detail Data Block Table Table 1 2 3 4 5 6 1. Base Table source 3. Trigger Access 5. Multirecord data block 2. Single-record data block 4. Nonbase table source 6. Record !
10.
Forms and DataBlocks Block 1 Block 2 Block 4 Block 3 Block 1 Block 1 Block 2 Block 1 Form A Form B Form C Open Form Open Form Multiple Form Modules Single Form Module ! @
Creating a NewModule Click on “Forms” Click on the plus sign of the tool palette “Module1” will appear A new module is now ready !
15.
Creating Data BlockItems Click on the Module1(last created ) and click the plus sign of the tool palette A window showing the options would appear Select the option of using “wizard” Click “next” on every screen till you reach the “layout editor”(in between you will be asked to enter the table which you can do with the “browse “ button. Proceed further till you reach “layout editor” !
16.
Fine tune layoutBy now you can see the items on the layout editor screen , which are nothing but the database columns represented on the screen Try to resize the items single click on one of the item and then keeping the mouse on the item’s boundary expand/contract it By going at the tool palette you can fill up the colours also in the items !
17.
Set object propertiesTo alter the properties of any Module/DataBlock/Item ,click on any one of them and then go to the “Tool “ option of the menu Adjust the property sheet as you desire !
18.
Add Code Towrite a pl/sql code on any Module/DataBlock/Item , go to the “Program” of the menu structure and click it Write the code and click “compile” Click “close”(do not choose the delete option) !
19.
Test for ModuleNow go to the object navigator and click The runtime screen would appear You can enter the data into the database tables (through the items being displayed on the screen) Open the SQL*PLUS to verify your data entry into the data base tables !
20.
Saving a FormModule Save form module: File --> Save Save Icon Enter Filename Save to one of the following: File System Database ! @
21.
Data Block FunctionalityOnce you create a data block with the wizards, Form Builder automatically creates: Form Module with database functionality Query,insert,update,delete Frame Object Items in the data block (TRIGGERS) Prompt of each item !
22.
Compiling the FormModule Compile Explicitly File-->Administration -->Compile file Form Compiler Component Command line interface Compile implicitly Tools -->Preferences Set the build before running preference ! @
23.
Module Types .FMB.FMX .FMT .MMB .MMX .MMT .PLL .PLX .PLD FORM MODULE MENU MODULE PL/SQL LIBRARY ! @
Relation Object Newrelation object in Object Navigator under master data block node Default name MasterDataBlock_DetailDataBlock Triggers and Program Units generated Automatically ! @
26.
Running A Master-DetailForm Module Automatic Block linking for Querying Inserting Default Deletion rules Cannot delete Master record if detail record exists !
27.
Working with DataBlocks and Frames Identify the components of the property palette Manipulate properties through the property palette. Control the behaviour and appearance of data blocks control frame properties create blocks that do not directly correspond to the database Delete data blocks and their components !
28.
Modifying the Appearanceand Behaviour of Data Blocks Reentrant Wizards Layout editor Data Block property palette Frame property palette !
29.
Displaying the PropertyPalette Toolbar Expand/Collapse Property Name Find field Search Backward Search Forward Property Value !
30.
Visual Attributes Visualattributes : are font,colour,and pattern properties can be set for form and menu objects A visual attribute is a form object with font,colour,and pattern properties Set visual attribute group property to the visual attribute object !
Data Block Propertygroups Each data block has several properties which may be divided into the following groups: General Navigation Records Database Advanced Database Scrollbar Font and Colour Character Mode International !
Database Properties Typeof Block - Data or Control Block Query, insert, update, and delete operations on the data block Data Block’s Data source Query Search criteria and default sort order Maximum Query time Maximum Number of records fetched !
Frame Properties Distancebetween Records Form Layout Style Member Tabular Layout Style Member Details !
39.
Creating a ControlBlock Click Data Blocks node Click Create icon or Select Navigator --> Create Select the ‘Build a new data block manually’ option in the New Data Block dialog !
40.
Deleting a Datablock Select data block for deletion Click Delete icon or Navigator --> Delete Click Yes in alert box !
41.
Items ..an importantattribute Basically there are two types of items INPUT ITEMS (text items,list items,push buttons) NON INPUT ITEMS(LOV’s , display items etc.) Note : The text items are the most often used for the data entry !
42.
Text Items Defaultitem type Interface object for Querying, Inserting, Updating, Deleting Behaviour defined in the property palette !
43.
Modifying the Appearanceof a Text Item Font and colour properties: Visual attributes Form name, size, weight, style, colour, pattern Distance between two records No. of items displayed !
44.
Prompts Text labelthat is associated with an item Several properties are available to arrange and manage prompts Use prompt properties of an item to change the prompt’s display style, justification, alignment, colour and font !
45.
Format Masks StandardSQL formats Dates FXDD-MON-YY Numbers L099G99D99 Non-standard formats Use double quotes for embedded characters “(“099”)”099”-”0999 Allow for the format mask’s embedded characters when defining the width property ! @
46.
Navigational Behaviour ofText Items Established by: Order of entries in Object Navigator Controlled by: keyboard navigable previous navigation item next navigation item !
47.
Database Properties Item’sdata source -- Base Table item or control item Query, Insert and Update operations on an item Maximum query length Query Case !
48.
Functional Properties EnabledJustification Multi-line Wrap style Case restriction Conceal data Keep cursor position Automatic skip Pop-up menu !
Keyboard Navigable andEnabled Properties Set both properties to allow or disallow navigation and interaction with text item When enabled is set to YES , keyboard navigable can be set to YES or NO When enabled is set to NO , the icon is always non-navigable !
Creating Additional InputItems Identify the item types that allow input Create a check box create a list item create a radio group !
53.
Other Input ItemsItem types that accept user input.These Include: Check Boxes List Items Radio Groups Can Allow: Insert, Update, Delete and Query !
54.
Check Boxes Two-Stateinterface Object Checked Unchecked Not Limited to two values ! @
55.
Creating a CheckBox Convert an existing item to a check box item Use check Box tool in the layout editor Use create icon in the object navigator Check box Properties: Data Type Label Access Key Value when checked Value when unchecked Mapping of other values Mouse Navigate !
List Items Setof mutually exclusive choices,each representing a different value Three list styles available Space_saving alternative to a radio group Smaller scale alternative to an LOV !
58.
List Item SpecificProperties Elements in List List elements List item value List style Mapping of other values Mouse Navigate ! @
Radio Groups Setof mutually exclusive radio buttons,each representing a value Use: To display two or more static choices As an alternative for a list item As an alternative for check box ! @
61.
Creating a RadioGroup Convert an existing Item Create a new radio group item in the layout editor Use the create icon in the object navigator Radio group and radio button properties Radio Group Datatype Mapping of other values Mouse Navigate Radio Button Access Key Label Radio Button Value !
62.
Creating Non-Input ItemsIdentify Item types that do not allow input Create a display item Create an image item Create a button Create a calculated Field !
63.
Non-Input Items Itemtypes that do not accept direct user input include: Display Items Image Items Calculated items Buttons ! @
64.
Display Items Displayitems are similar to text items Display items cannot: Be edited Be queried Be navigated to Accept user input Display Items can: Display date Conserve resources ! @
Image Items InterfaceControl Used to display bitmapped images From file system-supported file type From database-LONG RAW column !
67.
Image Specific ItemProperties Image Format Image Depth Compression Quality Display Quality Show palette Sizing Style Show Horizontal Scrollbar Show Vertical Scrollbar !
68.
Buttons Interface controlCannot display/represent data Use to initiate an action Display as: Text Button Iconic !
69.
Buttons Use Buttonsto: Move Input Focus Display an LOV Invoke an editor Invoke another window Commit data Issue a query Perform calculations !
70.
Button Specific ItemProperties Label Mouse Navigable Default Button Iconic Icon filename ToolTip ToolTip visual attribute group !
Calculated Fields Acceptitem values that are based on calculation Are read only Can be expressed as: Formula Summary !
73.
Calculation Modes FormulaCalculated item value is the result of a horizontal calculation Involves bind variables Summary Calculated item’s value is a vertical calculation Summary performed on values of a single item over all rows in a block !
74.
Item Properties Specificto the Calculated Field Formula Calculation Mode Formula Summary: Calculation Mode Summary Function (AVG, COUNT,MAX, MIN, STDDEV, SUM, VARIANCE) Summarized block Summarized Item ! @
75.
Items Based onFormula Rules: Must not invoke restricted built-ins Cannot execute any DML statements . Do not terminate PL/SQL expressions with a semicolon Do not enter complete PL/SQL statement in assignment expressions Book id Book name Price Qty Total Cat 1 2 3 4 200 120 50 25 5 4 9 3 1000 480 450 75 Books NVL((:s_books.price * :s_books.qty),0) Formula Item !
76.
Items Based onSummary Rules for summary items Summary Item must reside in: The same block as the summarized item ,or A control block with single record property set to yes Summarized item must reside in: A data block with query all records property or pre-compute summaries property set to YES , or A control block Data type of summary item must be number unless using MAX or MIN !
77.
Items Based onSummary Book id Book name Price No of copies Total 1 2 3 4 200 120 50 25 5 4 9 3 1000 480 450 75 Books Summarised Item Total Price 2,005 Summary Item !
78.
Creating LOVs andEditors Describe LOVs and Editors Design, create, and associate LOVs with text items in a form module Create editors and associate them with text items in a form module !
79.
LOVs and EditorsLOVs List of Values for text items Dynamic list or static list Independent of single-text items Flexible and efficient Editors Override default editor Used for special requirements like larger editing window, position, colour, and title System editor available as an option ! @
80.
LOVs Book NameAuthor Name select bookname, authorname from books ; Books Table Books record group Books LOV !
LOV Queries Avoidvery large queries -- use restrictions Use column in LOV to validate user input -- place this column first in SELECT list Define return items later, or use optional INTO clause Use optional WHERE , GROUP BY, and ORDER BY clauses ! @
LOV Column MappingBook Name Author Name select bookname, book_id,authorname from books; Books table Books record group Books LOV Book id Book id Tc0001 St0002 Hidden columns Book Name Author Name ! @
85.
Editors Defining anEditor - A user defined or default Form Builder editor associated with text items. Associate one of three types of editors with a text item. Set text items editor property to one of the following: Null (default form builder editor) editor_name (customized editor) SYSTEM_EDITOR (external editor) !
86.
Creating Windows andCanvases Describe Windows and content canvases Describe the relationship between Windows and content canvases Identify window and content canvas properties Display a form Module in multiple windows Display a form module on multiple layouts !
87.
Creating Windows andCanvases Describe the different types of canvases and their relationships to each other Identify the appropriate canvas type for different scenarios Create an overlay effect using stacked canvases Create a toolbar Create a tabbed interface !
88.
Windows and CanvasesWindow Container for form builder visual objects Canvas Surface on which you ‘paint’ visual objects To see a canvas and its objects display the canvas in a window !
Content Canvas ‘Base’canvas View occupies entire window Default Canvas type Each window should have at least one content canvas. !
91.
Windows WINDOW1 Createdby default with each new form module Modeless You can delete,rename,or change its attributes Use additional Windows to: Display two or more content canvases at once Switch between canvases without replacing the initial one Two type of windows: Modal and Modeless !
92.
Window Properties MDIParent Window X/Y Position Title Document Window Dialog Window Vertical Scrollbar Horizontal Scrollbar !
93.
GUI Hints Recommendationsabout window appearance and functionality If the Window Manager supports a specific GUI Hint and its property is set to YES , it will be used Functional properties for GUI Hints Close allowed Move and Resize allowed Maximize and Minimize allowed Inherit Menu !
94.
Creating a ContentCanvas Implicitly Layout Wizard Layout Editor Explicitly Create icon in Object Navigator !
Stacked Canvas Displayedon top of a content canvas Shares a window with a content canvas Size: Usually Smaller than the content canvas in the same window. Determined by viewport size Created in: Object navigator Layout editor ! @
Toolbars Special typeof canvas for tool items Three types: Vertical toolbar Horizontal toolbar MDI toolbar Provide: Standard look and feel Alternative menu or function key operation !
100.
Toolbar Related PropertiesCanvas properties Canvas type Window Width Height Window properties Horizontal toolbar canvas Vertical Toolbar canvas Form Module Properties Form Horizontal toolbar canvas Form Vertical toolbar canvas !
101.
Tab canvas Enablesyou to organize and display related information on separate tabs Consists of one or more tab pages Provides easy access to data Created in Object navigator Layout editor Items on a tab canvas Place Items on a tab page for user interaction Set item’s canvas,tab page properties !
Introduction to TriggersDefine Triggers Identify the different Trigger types Plan the type and scope of triggers in a form Describe the properties that affect the behaviour of a trigger Write trigger code Explain the use of built-in subprograms in D2K applications Describe the WHEN_BUTTON_PRESSED trigger !
104.
Form Builder TriggersPL/SQL PL/SQL PL/SQL Queries Validation Navigation Interaction Internal Events Errors/Messages Others Event Fire Trigger Types !
105.
Scope of aTrigger Scope Code Type Levels Form Block Item Pre- Post- When- On- Key- Statements PL/SQL User subprograms Built-in subprograms !
106.
Scope of aTrigger Item Level (ON-MESSAGE) Block Level (ON-MESSAGE) Form Level (ON-MESSAGE) ! @
107.
Scope of aTrigger When the cursor is on the Book_name item, a message fires the On-Message trigger of the Book_name item When the cursor is elsewhere in the Books block, a message causes the block-level On-Message trigger to fire because it is outside the scope of the item level trigger When the cursor is outside the Books block, a message causes the form-level On-Message trigger to fire, because the cursor is outside the scope of the other two On-Message triggers !
Variables in FormBuilder PL/SQL variables must be declared in a trigger or defined in a package Form Builder variables not formally declared in PL/SQL need a colon prefix in reference !
112.
Form Builder VariablesItems: For presentation and user interaction :block_name.item_name Global variables: session wide character variable :GLOBAL.variable_name System variables: form status and control :SYSTEM. variable_name Parameter variables: passing values in and out of a module :PARAMETER.name ! @
113.
Form Builder Built-inSub-programs Built-ins belong to either the standard extensions package no prefix required other Form Builder packages prefix required Limits of Use Unrestricted built-ins any trigger or sub-program Restricted built-ins only allowed in certain triggers and sub-programs called from such triggers Consult help system !
When-Button-Pressed trigger Fireswhen the operator clicks a button Allows restricted and unrestricted built-ins Used to provide convenient navigation, to display LOVs and many other frequently used functions Example: Show Books GO_BLOCK(‘Books’); EXECUTE_QUERY; !
117.
Functionality used inTriggers Description of the different types of Triggers with some examples Different styles of Messages and Alerts and their built-ins Runtime errors and built-ins A general overview on Query Array Processing Enter Query Mode Use of SYSTEM variables Validation at different levels Navigation !
Coding Item InteractionTriggers Valid commands SELECT items Standard PL/SQL constructs All Built-in Subprograms Use When-Validate-”Object” to trap the operator during validation !
120.
Example of When-ImageActivated BEGIN READ_IMAGE_FILE ('C:\orant\tools\doc20\guide21\gifs\bookicon.gif’ , 'GIF’, 'BEGIN.IMAGE’ ); END; !
121.
Runform Messages andAlerts System Alerts Application Messages Informative Error Working Application !
Errors and Built-insBuilt-in failure does NOT cause an exception Test built-in success with FORM_SUCCESS function IF FORM_SUCCESS THEN …. What went wrong? ERROR_CODE,ERROR_TEXT,ERROR_TYPE MESSAGE_CODE,MESSAGE_TEXT, MESSAGE_TYPE !
124.
Message Severity LevelsSeverity Level Description 0 All Messages 5 Reaffirms an obvious condition 10 Procedural mistake by user 15 Form not designed for action attempted by user 20 Cannot continue due to trigger problem 25 Condition resulting in form performing incorrectly >25 Messages that cannot be suppressed System.MESSAGE_LEVEL := severity level System.SUPPRESS_WORKING := ‘TRUE’ ! @
125.
Error Triggers On-errorFires when a system error message is issued Used to trap form Builder and Oracle Server errors On-Message Fires when an informative system message is issued Used to suppress or customize specific message Built-in functions : MESSAGE_CODE MESSAGE_TEXT MESSAGE_TYPE !
Query Triggers FirePRE-QUERY trigger Fetch A Row Into A New record Mark Record As valid Fire POST-QUERY trigger Validate any Record Changes Perform Query Construct SELECT….. Abort query on failure Flush record on failure Query Processing !
129.
WHERE Clause Threesources for the WHERE Clause Where clause block Property Example Record Query Where dialog WHERE Clauses are combined by the AND operator !
130.
ORDER Clause Twosources of ORDER Clause ORDER BY clause property Query Where dialog Second source for ORDER BY clause overrides the first one !
131.
Pre_Query, Post_Query Triggers Pre_Query Define at block level Fires once, before query is performed Post_Query Fires for each fetched record (except during array processing) Use to populate non-database items and calculate statistics !
132.
Using SELECT Statementsin Triggers Form Builder variables preceded by colon Query must return one row for success Code exception handlers INTO clause mandatory,with a variable for each selected column or expression ORDER BY not relevant ! @
133.
Coding For ENTER-QUERYMode Some triggers may fire in Enter-Query mode Set to Fire in ENTER-QUERY Mode Test mode during execution with :SYSTEM.MODE NORMAL ENTER-QUERY QUERY Some built-ins are illegal Consult online Help You cannot navigate to another record in current form !
Overriding Default QueryProcessing On-Fetch continues to fire until: It fires without executing CREATE_QUERIED_RECORD The query is closed by the user or by ABORT_QUERY It raises FORM_TRIGGER_FAILURE On-Select replaces open cursor,parse and execute phases !
136.
Obtaining Query Informationat Runtime SYSTEM.MODE to obtain the form mode SYSTEM.LAST_QUERY to obtain the text of the base table SELECT statement that was last executed by Form Builder Contains bind variables (ORD_ID = :1) before SELECT_RECORDS Contains actual values (ORD_ID=102)after SELECT_RECORDS !
137.
Obtaining Query Informationat Runtime GET_BLOCK_PROPERTY SET_BLOCK_PROPERTY Following block properties may be set for obtaining query information Get and Set DEFAULT_WHERE ORDER_BY QUERY_ALLOWED QUERY_HITS Get only QUERY_OPTIONS RECORD_TO_FETCH !
138.
Obtaining Query Informationat Runtime GET_ITEM_PROPERTY SET_ITEM_PROPERTY Following block properties may be set for obtaining query information Get and Set: CASE_INSENSITIVE_QUERY QUERYABLE QUERY_ONLY Get only: QUERY_LENGTH !
139.
Validation Form Buildervalidates at the following levels: Form Level Block Level Record level Item level Item level ! @
Validation Triggers Itemlevel When-Validate-item Block level When-validate-record if :s_issues.due_date < sysdate then message(‘enter due date correctly’); raise FORM_TRIGGER_FAILURE; End if; !
142.
Tracking Validation StatusNEW When a record is created Also for Copy Value from item or Initial Value CHANGED When the item is changed by the user or a trigger When any item in a new record is changed VALID When Validation of the item has been successful After records are fetched from database After successful POST or COMMIT Duplicated records inherit status of source !
About Navigation Whatis a navigation unit? A Navigation Unit is an invisible, internal object that determines the navigational state of a form. It keeps track of the object that is currently the focus of a navigational process. Navigation unit can be an object in the hierarchy: Outside the form Form Block Record Item Entering and Leaving Objects What happens if navigation fails !
145.
Navigation Properties FormModule Mouse navigation limit First Navigation data block Block Navigation style Previous navigation data block Next navigation data block Item Enabled Keyboard navigable Mouse navigate Previous navigation item Next navigation item !
146.
Navigation Triggers Pre-and Post- When New object Instance Fire during navigation Fire after navigation Does not fire if validation Does fire when validation unit is larger than trigger unit is larger than the object trigger object Allows unrestricted Allow restricted and built-ins unrestricted built-ins Handle failure by Is not affected by failure returning to initial object ! @
The Pre- andPost-Triggers Pre/Post-Form Pre/Post-Block Pre/Post-Record Pre/Post-Text-Item !
149.
Using Pre andPost Triggers Trigger Type Use to Pre-Form Pre-Block Validate - User, Time of day Initialize control blocks - Call another form to display messages Post-Form Perform housekeeping - erase global variables Before exit - Display messages to user Authorize access to the block Post-Block Validate the last record that had input focus Test a condition and prevent the user from leaving Pre-Record Set global variables Post-Record Clear global variables - Set a visual attribute for an item as the user scrolls down through a set of records. Perform cross field validation Pre-Text-Item Post-Text-Item Derive a complex default value. Record the previous value of a text item Calculate or change item values ! @
150.
Post-Block Triggers ExampleChanging the status of the book to LOST If (system.block_status =‘ new’ or system.block_status =‘changed’) and :s_returns.lost = 'Y' then s_copy.status=‘L’ ; !
151.
Navigation in TriggersBuilt-in routines for Navigation Function GO_FORM Navigates to an open form (in a multiple fprm application) GO_BLOCK Navigates to an indicated block Navigates to an indicated item Navigates to a specific record GO_ITEM GO_RECORD NEXT_BLOCK Navigates to the next enterable block NEXT_ITEM Navigates to the next enterable item NEXT_RECORD Navigates to the first enterable item in the next record NEXT_SET Fetches another set of records from the database and navigates to the first record that the fetch retrieves UP Navigates to the instance of the current item in the previous record DOWN Navigates to the instance of the current item in the next record PREVIOUS_BLOCK Navigates to the previous enterable block PREVIOUS_ITEM Navigates to the previous enterable item PREVIOUS_RECORD Navigates to the previous enterable record SCROLL_UP SCROLL_DOWN Scrolls the block so that the records above the top visible one display Scrolls the block so that the records below the bottom visible one display ! @
152.
Transaction Processing Describedetails of commit processing and commit triggers Supplement transaction processing by using triggers Allocate sequence numbers to records as they are applied to tables Implement Array DMLs !
153.
Transaction Processing Transactionprocessing includes two phases: POST Writes record changes to base tables Fires transactional triggers COMMIT Performs database commit Error result in: Rollback of the database changes Error messages displayed !
154.
The Commit Sequenceof Events Validate the form Pre-Commit Validate the block Pre-Delete Delete Row On-Delete Post-Delete 1 2 More records? Contd. !
155.
The Commit Sequenceof Events Copy value from item Pre-Update Check uniqueness Insert row On- Insert Post-Insert 1 2 More blocks? INSERT UPDATE More records? Pre-Insert Check uniqueness Update row On-Update Post-Update Post-Forms-Commit Commit changes Post-Database-Commit STOP !
156.
Characteristics of Committriggers Pre-Commit : Fires once if form changes are made or uncommitted changes are posted Pre/Post-DML : Fires for each record selected for DML operations On-DML : Fires per record,replacing default DML on row Use of DELETE_RECORD , INSERT_RECORD , UPDATE_RECORD Post-forms-Commits : Fires once even if no changes are made Post-Database-Commit : Fires once even if no changes are made NOTE : A commit-Trigger failure causes a rollback to the savepoint !
Testing the resultof Trigger DML SQL%FOUND SQL%NOTFOUND SQL%ROWCOUNT Example : if SQL%NOTFOUND then message (‘Book not available’); end if; !
159.
DML Statements IssuedDuring Commit Processing Rules DML statements may fire associated database triggers Using and retrieving ROWID Update Changed Columns and Column Security Locking Statements are not issued during default commit processing !
Overriding Default TransactionTransactional Triggers for logging on and off Trigger Do-the-right-thing Built-in Pre-Logon Pre-Logout On-Logon On-Logout Post-Logon Post-Logout - - LOGON LOGOUT - - !
162.
Running with non-OracleData sources Three ways to run against non-oracle Data sources: Oracle Open Gateways Oracle Open Client Adapter for ODBC Write appropriate transactional triggers Connecting with Open Gateway Cursor and save point mode form module properties Key mode and Locking mode block Properties Using Transactional triggers Call 3GL programs Database data block property !
163.
Getting and SettingCommit Status What is commit Status? Commit Status determines how the record will be processed during the next commit phase . SYSTEM.RECORD_STATUS NEW INSERT (Also caused by control items) QUERY CHANGED ! @
164.
Getting and Settingthe Commit Status System variables versus built-ins for commit status Built-ins for getting and setting commit status: GET_BLOCK_PROPERTY GET_RECORD_PROPERTY SET_RECORD_PROPERTY Warnings: Do not confuse commit status with validation status The commit status is updated during during validation !
165.
Implementing Array DMLArray Processing, processes groups of records at a time, reducing network traffic and thereby increasing performance. With DML array size greater than 1, the appropriate Pre-Triggers fire for all of the new, changed and deleted rows; all of the DML statements are issued and then all of the Post-Triggers fire. For Array Processing - Enable the array Processing option Specify a DML Array Size of greater than 1 Specify Block Primary Keys ! @
166.
Writing Flexible Code,Sharing Objects and Code and Introduction to Multiple Form Applications Describes flexible code and the built-in subprograms that assist flexible coding Discusses advantages of using system variables Writing code to reference objects directly and indirectly, using internal object id. Describing various methods for reusing objects and code Inheriting properties from property classes Grouping related objects for reuse Reusing objects from an object library Reusing PL/SQL code Calling one form from another form module !
167.
Flexible Code Isreusable code Is generic code Avoids hard-coded object names Makes maintenance easier Increases productivity !
System Status VariablesWriting the trigger code for WHEN-BUTTON-PRESSED on SAVE button Example : If :system.block_status=‘CHANGED’ then Commit_form; end if; !
170.
GET_”object”_PROPERTY Built-in subprogramsthat provide the same type of runtime information as built-in variables GET_APPLICATION_PROPERTY GET_FORM_PROPERTY GET_BLOCK_PROPERTY GET_RELATION_PROPERTY GET_RECORD_PROPERTY GET_ITEM_PROPERTY GET_ITEM_INSTANCE_PROPERTY !
FIND_Built-Ins The FIND_”object”built-in returns the id of the object being referenced by it. FIND_FORM FIND_BLOCK FIND_ITEM FIND_RELATION FIND_LOV FIND_WINDOW FIND_EDITOR FIND_VIEW FIND_CANVAS FIND_ALERT !
175.
Using Object IDsDeclare a PL/SQL variable of the same datatype Use a variable for any later reference to the object Use a variable within the current PL/SQL block only Example: DECLARE item_var item; BEGIN item_var := FIND_ITEM(:SYSTEM>CURSOR_ITEM); SET_ITEM_PROPERTY(item_var,position,30,35); SET_ITEM_PROPERTY(item_var,prompt_text,’Current’); END; !
Referencing Objects IndirectlyNAME_IN Function Returns The contents of the variable Character string USE Conversion functions for NUMBER and DATE COPY Procedure Allows Direct Copy eg: COPY(‘thornbirds’,’S_BOOKS.book_name’); eg: COPY(‘thornbirds’,:GLOBAL.book_name); Indirect Copy eg: COPY(‘thornbirds’,NAME_IN(‘GLOBAL.customer_name’)); Assigns a value to an item whose name is stored in a global variable !
Property Classes CanvasView Properties Relation Properties Item Properties LOV Properties Block Properties A property class is a named object that contains a list of properties and their settings ! @
180.
Property Class IconsAdd Property Delete Property Property Class Inherit Property !
181.
Inherited and VariantProperties Inherited Property An inherited property is one that takes it’s value from the property class that you associated with the object. An inherited property displays with an arrow to the left of the property name Variant Property A variant property is one that has a modified value although it is inherited from the property class associated with the object. You can override the setting of any inherited property to make that property variant. Variant properties display with a red cross over an arrow ! @
Inheriting Properties Toinherit property values from a property class, set the Subclass Information Property To convert a Variant Property to an Inherited Property, change Inherited Property in the Property Palette to Variant Property To convert an Inherited Property to a Variant Property, overtype the Inherited value with a new value !
184.
Object Group Anobject group is a Logical Container for a set of Form Builder objects Enables you to Group related objects Copy multiple objects in one operation !
185.
Using Object GroupsIncluding a block into an Object Group includes it’s Items Item-level triggers Block-level triggers Relations Other Object Groups cannot be included into an object group Deleting an Object Group does not affect objects in the form module Object from a form module affects the object groups containing it !
186.
Copying Objects BooknameAuthor name Price Bookname Author name Price Ability to make an exact copy of the object !
187.
What Is Subclassing?Bookname Author name Price Bookname Author name Price Ability to make an exact copy of the object Bookname Author name Price Category Book-id Ability to add properties to an object !
188.
Subclassing Bookname Authorname Price Bookname Author name Price Ability to make exact copy of object Bookname Author name Price Category Book-id Ability to add to object Bookname Author name Price Ability to alter properties !
189.
Inheriting Changes BooknameAuthor name Price Bookname Author name Price Bookname Author name Price Category Book-id Ability to inherit changes Bookname Author name Price Making changes to parent Ability to inherit changes Ability to inherit changes !
190.
What Is anObject Library? Convenient container of objects for reuse Simplifies reuse in complex environment Supports and provides controls for corporate, project, and personal standards Simplifies sharing of reusable components Eliminates the need to maintain multiple referenced forms Saved to ‘.olb’ file or to the database !
191.
SmartClass An objectin an Object library that is frequently used as a Class is a Smart Class Can be applied easily and rapidly to existing objects Can be defined in many object libraries Can have many SmartClasses of the given object type !
192.
PL/SQL Libraries Alibrary is a separate module, holding procedures, functions and packages Direct reference to bind variables are not allowed Use sub-program parameters for passing bind variables Use functions, where appropriate, to return values !
Multiple Form ApplicationsBehaviour Flexible navigation between windows Single or multiple database connections Transactions may span forms, if required Commits in order of opening forms, starting with current form Links Data exchanged by global variables or parameter lists Code shared as required, through libraries and databases !
195.
Multiple Form SessionGlobal Variables Form A Form D Form B Form C Forms Runtime Open Open Open !
196.
Opening Another FormNotes: Control passes immediately to called form - no statements after open_form are processed Activate mode NO_ACTIVATE retains control in current form Transaction continues unless explicitly committed before !
197.
Opening Another FormExample: If book available open ISSUE form, else open DEMAND form if book_status=‘A’ then open_form(‘ISSUE’) ; else open_form(‘DEMAND’); end if; !
198.
Closing a Formwith EXIT_FORM Default functionality same as [Exit] key Commit_mode argument defines action on uncommitted changes Example : EXIT_FORM(DO_COMMIT); EXIT_FORM(NO_COMMIT); !