+ All Categories
Home > Documents > Introduction to Oracle Forms Builder

Introduction to Oracle Forms Builder

Date post: 02-Jun-2018
Category:
Upload: harouna-coulibaly
View: 260 times
Download: 0 times
Share this document with a friend

of 34

Transcript
  • 8/11/2019 Introduction to Oracle Forms Builder

    1/34

    Introduction to Oracle Forms Builder

    Dr. Awad KhalilComputer Science & Engineering Department

    AUC

    Major Forms Builder Tools

    Forms Builder has een Oracle!s main "orm de#elopment product "or more than $% earsDuring this time' Forms Builder applications were used in a main"rame' character(aseden#ironment' a client(ser#er en#ironment' and now in the )e en#ironment. Oracle!s De#eloperuses three di""erent components*

    An Integrated Design En#ironment +IDE, called Forms Builder de#elops "orms. -his tooplaces the desired design components into a inar "ile with a "ile etension o" ."m. -heinar "orm "ile cannot e eecuted until it is turned into machine code.

    A Forms Compiler that creates a compiled +machine language, "ile ased on the "orminar "ile. -his "ile has an etension o" ."m. It is more common' howe#er' to compile the "ilewithin the Forms Builder tool.

    A runtime engine called Forms Ser#er eecutes the compiled ."m "iles in a )een#ironment. Forms Ser#er is a middleware product that recei#es re/uests "rom a )erowser and dishes up a 0a#a applet ased on the "orm to the rowser

    Executing Forms in Web-based Environment

    )e applications rel on a )e rowser and a )e ser#er.

    -he )e ser#er controls coordination. )hen using a "orm on the )e' the eecutale "ileis registered with the )e ser#er.

    -o eecute the )e "orm' a user re/uests a U12 in his )e rowser. -he U12 points to anapplication registered within Forms Ser#er. A listner on the )e ser#er catches this U12 re/uestand passes it to Forms Ser#er. -he Forms Ser#er locates and eecutes the ."m "ile. It changesthe ."m "ile into a 0a#a applet and sends it to the )e rowser.

    -o eecute a "orm in a )e rowser' the client unit must ha#e an applet called 0Initiator.

    )hen an Oracle "orm is eecuted through the )e ' the )e ser#er storing the "orm sends the0initiator applet to the client!s )e rowser +i" it does not alread eist on the client,. 0initiator is ageneric applet' which is downloaded once to the client. It is actuall a plug(in that ensures the)e rowser can interact with Forms Ser#er. It is also used to paint the "orm within the rowser'#alidate data' and communicate with Forms Ser#er. Forms Ser#er reads and eecutes the ."m"ile. Forms Ser#er communicates with the dataase and with the applet on the )e rowser.

    1

  • 8/11/2019 Introduction to Oracle Forms Builder

    2/34

    Launching Forms Builders IDE

    One wa to launch Forms Builder' ou select*

    Start 33 All 4rograms 33 Oracle De#eloper Suite 33 Forms De#eloper 33 Forms Builder

    2aunching Forms Builder opens the )elcome to the Forms Builder and then the O5ect

    6a#igator' the heart o" Forms uilder. O5ect 6a#igator is a Forms Builder tool that displas the#arious "orm components as well as other "orm modules' menu modules' and dataase o5ects-his tool enales ou to select #arious "orm o5ects "or modi"ication. It also allows ou to add anddelete "orm components. )hen Forms Builder is launched' the O5ect 6a#igator displas onelan7 module. A module is another name "or the "orm inar "ile that contains the applicationcomponents.

    2

  • 8/11/2019 Introduction to Oracle Forms Builder

    3/34

    bject !avigator

    3

  • 8/11/2019 Introduction to Oracle Forms Builder

    4/34

    Logging on to the racle Database

    )hen starting a Forms Builder session' "irst connect to the Oracle dataase. -he dataase"urnishes much o" the in"ormation ou need to de#elop the "orm. It supplies Forms Builder withthe names o" tales and columns and each column!s data tpe' length' and prompt properties. Italso supplies constraint in"ormation that is used to set re/uired +6O- 6U22, properties and rangeproperties.

    -here are se#eral methods o" connecting to Oracle' in "act' ou can use Forms Builder "orman tas7s without connecting to the dataase. 8owe#er' Oracle attempts to log ou on to thedataase whene#er Forms Builder needs some in"ormation "rom the dataase. -his attempt canoccur when ou are using a wi9ard or compiling a 42:S;2 script. )hen Forms Builder attempts tolog ou on to the dataase' it displas a modal dialog o re/uesting ou to enter the "ollowing *

    4

  • 8/11/2019 Introduction to Oracle Forms Builder

    5/34

    6ormall' a de#eloper connects to Oracle when starting a Forms Builder session per"orming one o" the "ollowing "unctions*

    From the menu' clic7 File:Connect

    4ress the Control and 0 7es. -hese are IDE hot 7es that per"orm the same "unction asthe File:Connect menu selection.

    For our "irst practice session' launch Forms Builder and connect to the Oracle dataase per"orming these steps*

    2ocate and select the Forms Builder option on the Start menu.

    I" the )elcome to the Forms Builder dialog o opens' clic7 the Cancel utton.

    )hen ou are in the main wor7 area' log on to Oracle selecting File:Connect menuoption.

    Enter our Oracle ID in"ormation into the Connect dialog o. -his generall consists o" theOracle ID' password' and connect string. I" ou are using an Oracle dataase that is installedon our 4C' the de"ault ID is scott:tiger and a connect string is needed.

    Clic7 the Connect utton. -he dialog o disappears when ou are connected.

    Forms Builder IDE Tools

    Forms Builder has tools that are used to uild "orms*

    O5ect 6a#igator* 2ocates and na#igates to an "orm component. Doule(clic7ing ano5ect in the O5ect 6a#igator causes Forms Builder to displa the selected o5ect within theappropriate Forms Builder tool. -he O5ect 6a#igator can also e used to create' delete' cop'and rename "orm components. +can e launched clic7ing F

  • 8/11/2019 Introduction to Oracle Forms Builder

    6/34

    restriction' length o" #alue' data tpe' or prompt #alue. 4roperties can e used to sustantiallcontrol a "orm!s eha#ior. Doule(clic7ing an o5ect in the O5ect 6a#igator generall opensthe 4ropert 4allette tool. +can e launched clic7ing F=,.

    2aout Editor* It paints the "orm. -his tool allows ou to mo#e and arrange "orm o5ects' set

    "ont and "ill colors' add components to the "orm' and add a oilerplate. Doule(clic7ing anggraphic component in the O5ect 6a#igator causes the laout Editor to displa a can#as thatcontains the graphic o5ects. +can e launched clic7ing F$,.

    42:S;2 Editor* Used to write the 42:S;2 scripts needed a "orm. -hese 42:S;2 scriptsare placed in triggers associated to a "orm o5ect or into program units that are emedded inthe triggers. A trigger is a 42:S;2 code loc7 whose eecution is ased on a "orm e#ent' suchas doule(clic7ing a "orm o5ect' na#igating to another tet item' or pressing an F 7e. 4rogramunits are 42:S;2 scripts that are named and stored within a "orm or in a dataase. +can elaunched clic7ing F>>,.

    "ro#erties "alette

    La$out Editor

    6

  • 8/11/2019 Introduction to Oracle Forms Builder

    7/34

    "L%&'L Editor

    (reating a &im#le Form )sing the Data Bloc* and La$out Wi+ards

    Forms are composed o" a #ariet o" o5ects' ut each "orm must ha#e the "ollowing threecomponents*

    Data Bloc7* this is the "orm o5ect that contains data elements. -he data loc7 is usuallclosel related to a dataase tale or #iew. -he data loc7 elements recei#e dataase #alues"or displa' update' or deletion. Data loc7s also recei#e in"ormation that has een input "or

    insertion into the dataase. Data loc7s generate dnamic S;2 statements +I6SE1-U4DA-E' and DE2E-E, that interact with the dataase.

    Can#as* -his is the "orm o5ect that is shown to the user and is displaed in the 2aoutEditor. All displaed "orm components must e placed on a can#as to e displaed. Can#asesalso contain graphic smols and a oilerplate.

    )indow* -his is the "orm o5ect that displas the can#as.

    7

  • 8/11/2019 Introduction to Oracle Forms Builder

    8/34

    -hese three components can e created manuall using the O5ect 6a#igator' ut it ismuch more common to use the Data Bloc7 and 2aout )i9ards' especiall "or newl created"orms.

    (reating a Form Module -he "irst tas7 in creating a "orm is to create a "orm module. A "orm module is a inar "ile

    that holds the "orm components. -o determine whether a "orm module has een rought into theForms Builder session' ou must displa the O5ect 6a#igator. -he O5ect 6a#igator displas ahierarchical list o" parent and child o5ects. For eample' i" we loo7 at the O5ect 6a#igator showne"ore' we ca recogni9e si o5ects +or parents, on the le"t side o" the O5ect 6a#igator* FO1?S?E6US' 42:S;2 2IB1A1IES' OB0EC- 2IB1A1IES' BUI2-(I6 4ACKA@ES' and DA-ABASEOB0EC-S. Under the FO1?S o5ect is a node called ?ODU2E>. this is one instance o" theFO1?S parent o5ect and is a child node. -he O5ect 6a#igator allows ou to ha#e multiple childnodes. Under the ?ODU2E> node are additional child nodes* -1I@@E1S' A2E1-S' A--AC8ED

    2IB1A1IES' DA-A B2OCKS' and so on. -heses are "orm o5ects or components that ma7e up a"orm. -he O5ect 6a#igator las out all a#ailale o5ects in this hierarch o" parent and childo5ects or nodes.

    I" a "orm module eists' ou see the name o" the "orm as a FO1?S o5ect child node.Under the FO1?S node is a child node called ?ODU2E>. -his is a new created "orm moduleread "or modi"ication. -he "orm module is named ?ODU2E> de"ault. Forms Builder generatesa new de"ault name whene#er a new module is created' and the de"ault name changes to thename o" the "ile when the module is sa#ed.

    -he O5ect 6a#igator can contain multiple "orm modules. Selecting an "orm module child

    node causes that "orm module to e the current module. Eisting "orm modules can e roughtinto Forms Builder in two was*

    Using the File:6ew menu option to create a new "orm module.

    Using the File:Open menu option to retrie#e an eisting module "rom the "ile sstem.

    )sing the Data Bloc* Wi+ard to (reate a Data Bloc*

    6ow that ou ha#e seen a "orm module' ou are read to create the "irst o" the threemandator o5ects listed pre#iousl* the data loc7. Use the Data Bloc7 )i9ard to create new data

    loc7s and modi" them. -he wi9ard can e launched in three was*

    8

  • 8/11/2019 Introduction to Oracle Forms Builder

    9/34

    Use the -ools:Data Bloc7 )i9ard menu option.

    Clic7 the DA-A B2OCKS node in the O5ect 6a#igator. Clic7 the Create tool on the le"ttoolar. -he icon "or this tool has a green plus sign. -his option causes a dialog o to open.ou are prompted to either launch the Data Bloc7 )i9ard or to uild it manuall.

    Use the )elcome to the Forms Builder dialog o clic7ing the Use the Data Bloc7)i9ard radio utton.

    As stated earlier' the Data Bloc7 )i9ard can e used to create a new data loc7 and modi"an eisting loc7. I" ou selected an eisting loc7 in the O5ect 6a#igator' the Data Bloc7 )i9arddisplas in"ormation aout this data loc7. I" ou want to create a new data loc7' e sure that aneisting data loc7 is not selected. Forms generall contain se#eral data loc7s. A"ter creating the

    "irst data loc7' it is #er eas to attempt to create a second data loc7 while the original is stillselected. I" ou launch the Data Bloc7 )i9ard with a data loc7 selected' the wi9ard modi"ies thecurrentl selected data loc7 and eliminates the settings that ou ha#e estalished. -his is acommon error "or no#ice de#elopers. -he launch the Data Bloc7 )i9ard while a data loc7 isselected. )hen the are "inished' the components o" the "irst data loc7 are gone' lea#ing themmodi"ied. I" ou want to create a new data loc7' e sure that a non(data loc7 "orm module o5ectis selected e"ore launching the Data Bloc7 )i9ard. -his causes Forms Builder to create a newdata loc7

    9

  • 8/11/2019 Introduction to Oracle Forms Builder

    10/34

    -he Data Bloc7 )i9ard consists o" a series o" modal dialog oes or pages that allow outo set a numer o" data loc7 properties or speci"ications. -he )elcome to the Data Bloc7 )i9ardpage appears "irst. -here is a Displa this page net time chec7 o in the lower(le"t corner o" thepage. Clic7ing this o to clear to clear the chec7 mar7 pre#ents this dialog o "rom appearing.Each o" the wi9ard pages has Bac7 and 6et uttons that allow ou to mo#e etween the wi9ardpages. Clic7ing the 6et utton on the Data Bloc7 )i9ard page opens the "irst important wi9ardpage.

    &etting the Bloc*s Data &ource T$#e

    -he net Data Bloc7 )i9ard page' the -pe page is used to enter the data loc7!s datasource tpe. -his dialog o has two radio uttons* -ale or iew and Stored 4rocedure. Selectingthe -ale or iew option sets up the data loc7 to use an Oracle tale or #iew. A tale is adataase o5ect that stores records. iews are stored SE2EC- statements that create and returnresult set or deri#ed tale. Stored procedures are named 42:S;2 scripts that reside in thedataase. -he can e used in con5unction with a 1e" Cursor and used as a data source. -he-ale or iew option is the more common option

    -he net wi9ard page is used to set the data source. -his page does not appear unless ouare logged on to Oracle. I" ou were not pre#iousl logged on' ou are prompted to log on toOracle e"ore the page appears. 6ote the "ollowing "eatures o" this page*

    -ale or #iew* -et item used to document the name o" the data source tale or #iew.

    Browse* Button that launches the -ales dialog o used to search and identi" tales and10

  • 8/11/2019 Introduction to Oracle Forms Builder

    11/34

    #iews "or the -ale or iew tet item.

    1e"resh* Button that populates the A#ailale Columns list o. Use this utton onl i" adataase change occurs while the wi9ard is open.

    En"orce data integrit* Chec7 o that causes Forms Builder to add the target tale!sdataase constraints to the data loc7 item properties.

    A#ailale Columns* 2ist o displaing columns a#ailale "or the data loc7.

    Dataase Items* 2ist o displaing columns that will e placed in the data loc7.

    ?o#e uttons* Four uttons that appear etween the list oes. -he are used to add andremo#e columns "rom the list oes. Single(arrow tools mo#e onl the selected columnsdoule(arrow tools mo#e the entire contents o" the list o. Doule(clic7ing an list o columnmo#es it to another list o. -he Delete 7e can also e used to remo#e columns "rom theDataase Items list o.

    11

  • 8/11/2019 Introduction to Oracle Forms Builder

    12/34

    12

  • 8/11/2019 Introduction to Oracle Forms Builder

    13/34

    13

  • 8/11/2019 Introduction to Oracle Forms Builder

    14/34

    It is not necessar to place all a#ailale columns into the data loc7 howe#er' an tale

    column that contain a 6O- 6U22 constraint must e selected to per"orm D?2 operations withouterrors.

    Clic7ing an list o o5ect on the -ales dialog o and clic7ing the OK utton populates

    tet items on the Data Bloc7 )i9ard -ale page. -he selected tale name will appear in the wi9ard-ale or iew tet item. In addition' the wi9ard page' A#ailale Columns list o' will e populatedwith the selected tale!s columns. -he -ales dialog o is a common Oracle tool. Oracle is adistriuted dataase' and the target data can e located on a #ariet o" Oracle installations. -hedialog o aids ou in searching the #arious installations and in locating the appropriate datasource. 6ote the "ollowing dialog o characteristics*

    Displa* A series o" chec7 oes used to "ilter the dataase o5ects.

    Current user* Allows o5ects owned ou' the de#eloper' to appear in the list.

    Other users* Allows o5ects on which ou ha#e een granted pri#ileges to appear.

    -ales* Allows dataase tales to appear.

    iews* Allows #iews to appear.

    Snonms* Allows snonm names to appear. A snonm is another name "or a dataaseo5ect.

    Dataase o5ect list o* Displas the results o" a dataase search ased on the #alues inthe Displa chec7 oes. -he list o has two components* -AB2E and O)6E1. -AB2Econtains the name o" the o5ect. O)6E1 lists the Oracle ID that owns the o5ect. Blan7 #aluesindicate the current user owns the o5ect.

    )sing the La$out Wi+ard to "lace Data Bloc* Items on a (anvas

    14

  • 8/11/2019 Introduction to Oracle Forms Builder

    15/34

    A"ter the data loc7 is created along with the data loc7 items associated to tale columnsthe items must e placed on a can#as. -his is generall done using the 2aout )i9ard' which cane launched "rom the Data Bloc7 )i9ard Congratulations page or "rom a menu option. Data loc7items are onl displaed placing them on a can#as and displaing the can#as within a window.

    All o" these items can e created manuall using the Create tool in the O5ect 6a#igator. It iseasier and /uic7er' howe#er' to use the 2aout )i9ard to associate the data loc7 items with acan#as. As a "orm de#eloper' ou use the 2aout Editor "or the "ollowing tas7s*

    Create a can#as "or the "orm i" one has not een created.

    Create additional can#ases i" needed.

    Create ta pages' which are special tpes o" can#ases that o#erla each other.

    Associate a data loc7 item to a can#as or ta page.

    Set the data item!s prompt or lael tet. A prompt is the oilerplate tet that descries a"orm item.

    Set the data item!s width.

    Set the asic data laout.

    Set the data displa properties' including the numer o" records displaed.

    Setting these properties goes a long wa toward "ormatting our "orm. -he 2aout )i9ardis launched either o" these methods*

    15

  • 8/11/2019 Introduction to Oracle Forms Builder

    16/34

    Choosing the Create the data loc7' and then call the 2aout )i9ard option on the DataBloc7 )i9ard Congratulations page.

    Clic7ing -ools:2aout )i9ard on the menu.

    -he "irst 2aout )i9ard page is the )elcome page. -his panel does not ser#e an realpurpose and can e disaled clic7ing the Displa this page net time chec7 o to clear thechec7mar7.

    &etting the (anvas

    -he Can#as wi9ard page is the "irst page o" importance. It identi"ies the can#as that isassociated to the data loc7 items. -his can e a new can#as or an eisting can#as +s can#as candispla multiple data loc7s,. -he Can#as wi9ard page is also used to determine the tpe o"can#as. Fi#e tpes are a#ailale* content' stac7ed' #ertical toolar' hori9ontal toolar' and ta.

    Content is the asic "orm can#as and is the de"ault. All "orms must ha#e at least one contentcan#as. 6ote the "ollowing Can#as wi9ard page "eatures*

    Can#as* A pull(down list o" 6ew Can#as option and all pre#iousl created can#ases. oumust choose a can#as on which to place the data loc7 items.

    -pe* A pull(down list o" can#as tpes.

    -a 4age* A pull(down list o" new ta page options and all eisting ta pages. -he #alues inthis list pertain to the selected can#as' and the list o is acti#e onl i" the can#as is a tacan#as.

    (anvas Wi+ard "age

    16

  • 8/11/2019 Introduction to Oracle Forms Builder

    17/34

    Identi,$ing Data Bloc* Items ,or Dis#la$

    -he Data Bloc7 wi9ard page "ollows the Can#as wi9ard page and is used to set two data

    loc7 item properties* Can#as and isile. -he properties are not displaed on the page' utmo#ing an item "rom the A#ailale Items list to the Displaed Items list sets the propert #alues.-he "ollowing descries what occurs mo#ing an item to the Displaed Items list*

    Can#as* An item propert that associates the item to the can#as. I" this item has a 6U22#alue it does not appear. I" a Can#as propert contains a con#as name' it appears on thenamed can#as. ?o#ing an item to the Displaed Items list sets the Can#as propert to thecan#as identi"ied on the Can#as page.

    isile* An item propert that determines whether the item appears when the "orm iseecuted. I" this #alue is 6O' the item appears in the 2aout Editor +i" the Can#as propert isset to a can#as, ut not when the "orm is eecuted. A #alue o" ES causes the item to appear.

    ?o#ing an item to the Displaed Items list sets this propert to ES.

    Data Bloc7* 4ull(down list that displas the "orm!s data loc7s. -his setting determines thedata loc7 suppling the items.

    A#ailale Items* 2ist o displaing data loc7 items a#ailale "or displa. -hese items wilcon"orm to the selected data loc7.

    17

  • 8/11/2019 Introduction to Oracle Forms Builder

    18/34

    Displaed Items* 2ist o displaing data loc7 items that will e displaed.

    Item -pe* 4ull(down list that sets the selected item!s tpe. -he de"ault is -et Item.Eamples o" other tpes are Displa Item' Chec7 Bo' and 4op 2ist.

    iew* 4ull(down list used with a radio group item to set up radio uttons.

    Data Bloc* Wi+ard "age

    &etting the Item "rom#t and Width

    -he Items wi9ard page sets prompt tet' as well as the width and height o" the displaeddata items. 4rompt -et is the oilerplate that descries the data item and appears ad5acent to an

    item on the can#as. -he de"ault prompt tet is ased on the dataase column namesUnderscores and special characters contained in the column name are stripped out o" the name'lea#ing the de"ault. -he width' height' and prompt tet #alues are data item properties and can ereset using the 4ropert 4alette. -he Items wi9ard page contains a single list o composed o""our #alues per row*

    6ame* Data loc7 item names. -his #alue cannot e changed.

    18

  • 8/11/2019 Introduction to Oracle Forms Builder

    19/34

    4rompt* Data item!s prompt tet. -his #alue can e changed.

    )idth* Data item!s width. -his #alue can e changed.

    8eight* Data item!s height. -his #alue can e changed.

    Items Wi+ard "age

    &etting the &t$le

    -he Stle wi9ard page determines the initial laout o" the displaed data items. -he pageconsists o" two stle setting radio uttons* Form and -aulate. )ith a Form stle' a record!s itemsare displaed in a numer o" rows. -his stle wor7s est when the "orm is a regular entit

    instance. )ith a taular stle' a numer o" records are displaed in a series o" columns. Each rowin the laout is a dataase record. -his stle wor7s est when the "orm is to displa multiple rows.Data entit attriutes in a one(to(man relationship are o"ten displaed on can#ases that ha#e acomination o" "orm and taular stles. -he data "rom the parent entit +"or eampleDE4A1-?E6-, is #iewed in "orm laout' and the data "rom the child entit +"or eampleE?42OEE, is #iewed in the taular stle. Forms Builder calls this a master(detail(laout.

    &t$le Wi+ard "age

    19

  • 8/11/2019 Introduction to Oracle Forms Builder

    20/34

    &etting the !umber o, o.s/ Frame Title/ Distance Bet.een ecords/ and the&crollbar

    -he net to last 2aout )i9ard page is the 1ow page' which is used to set two data loc7properties* 1ecords Displaed and Scrollar. -he de"aults "or these properties are > and 6O'meaning onl one data loc7 record is displaed' and the can#as does not ha#e a scrollar "orthe data loc7!s records. ou generall use these settings on "orm stle laouts. -aular stlelaouts generall displa multiple records. -o displa multiple records' set the 1ecords Displaedoption to a #alue greater than >. it is #er hand to ha#e a scrollar "or a taular stle laouts.Clic7 the Displa Scrollar chec7 o to displa a scroller on the can#as.

    -he 1ows page is also used to set "rame properties. Frames are can#as child o5ects usedto "ormat sets o" attriutes and are discussed later. 8owe#er' "or now ou should understand thatthe Frame -itle and Distance Between 1ecords properties can e set on this wi9ard page. -he

    Frame -itle propert is a oilerplate that descries the displaed items. -he Distance Between1ecords causes space to appear etween successi#e rows o" records.

    o.s Wi+ard "age

    20

  • 8/11/2019 Introduction to Oracle Forms Builder

    21/34

    (om#leting the La$out and 0ie.ing the Form bjects

    -he Congratulations page is the last page o" the 2aout )i9ard. Clic7ing the Finish uttoncauses a numer o" "orm o5ects to e created and properties set. ou can mo#e ac7wardsthrough the wi9ard chec7ing the settings e"ore clic7ing the Finish utton' and each o" the pageshas a Finish utton' so ou can "inish creating the laout on an wi9ard page.

    A"ter completing the tas7s in the Data Bloc7 and 2aout )i9ards' ou ha#e de#eloped allthe "orm o5ects needed to eecute the "orm in client(ser#er or )e en#ironments. -he "orm nowhas the "ollowing power"ul capailities*

    1ecords can e added to the dataase.

    Dataase records can e modi"ied.

    1ecords can e deleted "rom the dataase.

    Etremel comple /ueries can e eecuted against the dataase.

    21

  • 8/11/2019 Introduction to Oracle Forms Builder

    22/34

    (ongratulations Wi+ard "age

    -he "ollowing "igure illustrates the "orm that was created using the settings in the pre#ious

    "igures. -he "orm is displaed in the 2aout Editor. 6otice that the data loc7 items are located inse#eral rows' as is the "orm stle. -o the le"t 2aout Editor is the O5ect 6a#igator displaing the#arious "orm o5ects that are listed here.

    22

  • 8/11/2019 Introduction to Oracle Forms Builder

    23/34

    (om#iling and &aving the Form Modules

    A"ter creating the "orm modules' the must e con#erted to machine code compiling themodule. -his is generall done within Forms Builder' ut an eternal product called FormsCompiler can e used. Forms Compiler is generall not used when ou are de#eloping the "orm

    ecause its main purpose is to compile eisting "orms a"ter a product upgrade. Using FormsBuilder' a "orm "ile can e compiled in these three was*

    Clic7 the 4rogram:Compile ?odule menu option.

    4ress the Control- +Crtl-, hot 7es.

    Eecute the "orm within Forms Builder using the pre"erence option that automaticallcompiles the "orm e"ore eecuting it.

    Compiling the "orm creates an eecutale "ile with a "ile etension ."m howe#er' it does

    not sa#e the inar ."m "ile. It is possile to sa#e an eecutale "ile ut no source code "or the"ile. In order to sa#e the inar "ile' ou must sa#e the "ile. -his is done in one o" two was*

    Clic7 the File:Sa#e As or File:Sa#e menu options.

    Clic7 the Sa#e tool on the toolar.Launching a Form )sing racle Forms Builder untime

    A"ter ou ha#e de#eloped and compiled a "orm' ou can run it. Forms are eecuted sending a U12 re/uest to Forms Ser#er +or launching Forms 1untime "or client(ser#erapplications,. Forms Builder contains a tool that enales ou to launch the "orm "rom within theIDE so that ou can run and test the "orm while ou are de#eloping it. Forms Builder allows ou toeecute the "orm as a )e application.

    Be"ore ou can eecute the )e "orm using Forms Builder' ou must start a listener. -helistener wor7s in con5unction with the internal Forms Builder )e ser#er. )hen the listeneridenti"ies a re/uest "rom a )e rowser' it noti"ies the Forms Ser#er o" the )e ser#er. FormsSer#er then ser#es up the re/uested "orm application and sends it to the )e rowser. I" ou areeecuting a "orm "or the "irst time on our 4C' the 0Initiator applet is downloaded. -he Start OC=0Instance window that launches the listener. -his window does not close' so ou should minimi9eit.

    4ractice launching the "orm "rom within Forms Builder "ollowing these steps*

    Use the O5ect 6a#igator or the 2aout Editor to select an o" the target "orm!scomponents. Selecting a component causes that "orm to e set as the current "orm' and FormsBuilder alwas eecutes the current "orm. Be sure that the listener is started e"ore launchingthe "orm. I" it does not eist on our wor7station' Forms Builder downloads 0Initiator the "irsttime ou launch a "orm.

    Clic7 the 1un Form tool on the hori9ontal toolar or select the 4rogram: 1un Form menu

    23

  • 8/11/2019 Introduction to Oracle Forms Builder

    24/34

  • 8/11/2019 Introduction to Oracle Forms Builder

    25/34

    or eliminate portions o" this eha#ior. Oracle "orms and all other computer "orms ha#e three asicoperating modes*

    -he "orm prompts the user "or #alues that determine which records are to e displaed.

    -he "orm displas the records retrie#ed "or #iewing or updating.

    -he "orm allows the user to add new records.

    an Oracle "orm is not di""erent. An Oracle "orm also has three modes' as "ollows*

    6O1?A2* -he data loc7 can e used to enter new records or to update and deletedisplaed records.

    E6-E1 ;UE1* -he data loc7 prompts the user to enter #alues that are used to identi"the displaed records.

    ;UE1* -he data loc7 retrie#es records "or the "orm. -hese modes do not pertain to the "orm itsel" the indicate the mode o" a data loc7 on the

    "orm. A "orm can contain multiple data loc7s' and each data loc7 can e in a di""erent mode. -he"irst thing ou must learn is how to distinguish which mode the data is in' and this is sometimes#er con"using.

    )nderstanding the !M3L Mode

    Data loc7s that are in the 6O1?A2 mode can e used to add records or to update

    records. -his ma sound strange' since it seems illogical to e ale to add and update at thesame time howe#er' it is true. A data loc7 in the 6O1?A2 mode alwas has at least one record

    in which the user can add a new record' and this is true e#en i" the data loc7 is displaingeisting records.

    25

  • 8/11/2019 Introduction to Oracle Forms Builder

    26/34

    -he "ollowing "igure illustrates this "eature. -he "igure depicts an eecuted )e "orm' which

    contains an Emploee data loc7. -he "orm uses a taular stle containing multiple records ratherthan a "orm stle laout. A /uer was eecuted on the data loc7 returning records. -he data loc7is in the 6O1?A2 mode. -he displaed Emploee tale records can e updated placing thecursor in an o" the tet items and entering the data. A new record can e added placing the

    cursor in the row immediatel "ollowing the last Emploee record and entering the data. -hus' thedata loc7 can e used to update eisting #alues and add new one!s at the same time.

    26

  • 8/11/2019 Introduction to Oracle Forms Builder

    27/34

    ou can alwas add records to a data loc7 that is in the 6O1?A2 mode. I" the "orm is

    displaing one record in a "orm stle laout or $% records in a taular laout' ou can press theDown arrow 7e to mo#e the cursor to the net record. Data loc7s' whether "orm or taular stlecontain all the records returned a /uer. Forms Builder alwas adds a row that can e used toinsert records a"ter the last record in the data loc7 result set. 4ressing the Down arrow 7e

    scrolls ou through the record set' until the lan7 row is displaed. Using the Form stle cansometimes e con"using. -his stle is used when one record o" the result set is displaed.

    )hen a "orm is "irst displaed' no data appears. -he displaed data loc7 is in the

    6O1?A2 mode. ou ma enter #alues into the displaed tet items i" ou choose howe#er' donot do so at this time. -he "ollowing "igure illustrates the "orm when is "irst displaed*

    Eecute a /uer pressing the ControlF>> 7es. -hese are hot 7es that cause Forms

    Builder to create and eecute a SE2EC- statement. -he results o" the SE2EC- statement arereturned to the data loc7.

    -he "ollowing "igure illustrates the "orm a"ter the /uer returns records. -his "orm was in the

    ;UE1 mode while it retrie#ed records to the data loc7. It is now in the 6O1?A2 mode .

    -he "orm displas a numer o" records' ecause it is a taular stle that displas multiple

    records. In some cases' the /uer could return more records than can e displaed the "orm.-his is especiall true "or a "orm in the "orm stle. ou can #iew the additional records pressingthe Down arrow 7e. -his causes the "orm to displa the net result set record. -he Up arrow 7ecauses the "orm to displa the pre#ious record.

    4ress the Down arrow 7e repeatedl until ou ha#e scrolled through the entire result set

    27

  • 8/11/2019 Introduction to Oracle Forms Builder

    28/34

    and a lan7 record is displaed where ou can enter data o" a new record. Sa#e the record pressing the ControlS 7e. 4ress the Down 7e to ma7e another lan7 record appear. FormsBuilder awas adds a lan7 record at the end o" the result set. 2ast' ou can close the "orm closing the )e rowser.

    )hen our result set is large and ou want to a#oid scrolling through the result set to "ind

    the lan7 record' ou can add a lan7 record at the current data loc7 record location per"orming one o" the "ollowing operations*

    Select the 1ecord:Insert menu option "rom the de"ault menu.

    Clic7 the Insert 1ecord tool on the de"ault toolar'

    Clic7 the appropriate "unction or hot 7e.)nderstanding the E!TE ')E4 and ')E4 Mode

    -he data loc7 is in the E6-E1 ;UE1 mode when it is prompting the user to enter a

    #alue. -here is one speci"ic identi"ier "or this mode. In the lower(le"t corner in the "orm status lineis the "ollowing message* Enter a query; press Ctrl+F11 to execute, F4 to cancel.

    It is etremel common to mista7e the E6-E1 ;UE1 mode "or the 6O1?A2 mode with

    no data loc7 records displaed. )hen a data loc7 +or "orm, is "irst displaed' it is placed in the6O1?A2 mode with no records displaed. It loo7s #irtuall identical to the "orm when it is in theE6-E1 ;UE1 mode i" the #alues had not een entered' ecept "or the message at the ottom(le"t o" the "orm. It is common operator error to mista7e the two modes' enter a row o" #alues' andthen tr to sa#e the #alues. Forms Builder issues an error message' ecause ou cannot sa#erecords in the E6-E1 ;UE1 mode. Users get upset ecause the ha#e entered a row o" data

    28

  • 8/11/2019 Introduction to Oracle Forms Builder

    29/34

    that will shortl e lost. It is important to 7now the current mode' and the message at the ottom o"the screen is the onl indication o" the di""erence etween the modes when this condition eists.

    -he purpose o" the E6-E1 ;UE1 mode is to de#elop the SE2EC- statement )8E1E

    clause. )8E1E clauses identi" speci"ic records that are to e retrie#ed "rom the dataase.SE2EC- statements are S;2 commands that instruct the Oracle dataase to locate and retrie#e

    records. Forms Builder creates dnamic SE2EC- statements ased on the #alues or argumentsentered in the E6-E1 ;UE1 mode.

    -he ;UE1 mode occurs a"ter the user has entered the )8E1E clause arguments into

    the data loc7 row and attempts to retrie#e records "rom the dataase that match the arguments4lacing the "orm into the ;UE1 mode causes a SE2EC- statement to e generated andeecuted placing the data loc7 into the ;UE1 mode. -he SE2EC- statement will create)8E1E clause arguments "or an #alue entered into the data loc7. -he data loc7 then passesthe SE2EC- statement to the Oracle. Oracle generates the result set and passes it ac7 to thedata loc7. Oracle returns all records that match the )8E1E clause arguments or no records atall.

    -he data loc7 is placed in the E6-E1 ;UE1 mode when ou per"orm one o" theseprocedures*

    Clic7 the ;uer:Enter menu option.

    Clic7 the Enter ;uer tool on the de"ault tool ar.

    4ress the appropriate "unction 7e FG in the client(ser#er en#ironment and F>> in the )een#ironment.

    Use one o" the "ollowing procedures to place the data loc7 in the ;UE1 mode in which it

    eecutes the SE2EC- statement*

    Clic7 the ;uer:Eecute menu option.

    Clic7 the Eecute ;uer tool on the de"ault toolar.

    4ress the appropriate "unction 7e FH in the client(ser#er en#ironment and ControlF>> inthe )e en#ironment.

    -he ;UE1 mode lasts onl as long as the SE2EC- statement is wor7ing. )hen result set

    is returned' the "orm is placed in one o" two modes*

    I" it returns records' the data loc7 is in the 6O1?A2 mode.

    I" it does not return records' the data loc7 is placed in the E6-E1 ;UE1 mode with the"ollowing message* F1?(=%*;uer caused no records to e retrie#ed. 1e(enter. -hismessage is prompting "or di""erent )8E1E clause arguments.

    29

  • 8/11/2019 Introduction to Oracle Forms Builder

    30/34

    (hanging Modes

    (urrentmode

    (haracteristics o, thecurrent mode

    !est mode or#rocedure

    Techni5ue

    NORMAL mode:

    no records

    displayed

    Data block is empty of all records

    and no ENTER QUERY messae

    appears

    !nsert ne" record Add #al$es to t%e first ro" of t%e data block&

    NORMAL mode:

    records displayed

    Data block displays records !nsert ne" record '& (croll to t%e end of t%e record s

    )& (elect t%e 1ecord:Insertmen$option from t%e defa$lt men$&

    *& +lick t%e Insert1ecordtool odefa$lt toolbar&

    ,& -ress t%e appropriate f$nction kFHfor client.ser#er andControlF>>for /eb&

    NORMAL mode:

    records displayed

    Data block displays records Update an e0istin record -lace t%e c$rsor on a displayed #al$e and mo

    NORMAL mode:

    records displayed

    Data block displays records Delete an e0istin record -lace t%e c$rsor on any #al$e on t%e taret ro

    and perform one of t%e follo"in:

    '& (elect t%e 1ecord:1emo#emselection&

    )& +lick t%e 1emo#e1ecordtoot%e toolbar&

    *& -ress t%e appropriate f$nction k

    Shi"tFfor client.ser#er andControlUpfor /eb&

    30

  • 8/11/2019 Introduction to Oracle Forms Builder

    31/34

    NORMAL mode No records are displayed and t%e

    1$ery messae is not displayed or

    records are displayed in t%e data

    block&

    -ermanently sa#e t%e c%anes

    2Oracle does not sa#e records

    $ntil a commit command is

    iss$ed3&

    '& (elect t%eAction:Sa#emen$option&

    )& +lick t%e Sa#etool on t%e tool*& -ress t%e appropriate f$nction k

    F>%for client.ser#er and Contfor /eb

    +$rrent mode +%aracteristics of t%e c$rrent mode Nest mode or proced$re Tec%ni1$e

    NORMAL mode No records are displayed and t%e

    1$ery messae is not displayed or

    records are displayed in t%e datablock&

    -lacin t%e data block in t%e

    ENTER QUERY mode&

    '& (elect t%e Q$ery4Enter men$

    selection&

    )& +lick t%e ENTER QUERY toolt%e toolbar&

    *& -ress t%e appropriate f$nction k

    56 for client.ser#er and 5'' for

    NORMAL mode No records are displayed and t%e

    1$ery messae is not displayed orrecords are displayed in t%e data

    block&

    +lose t%e form& 2yo$ can only

    close t%e form "%en t%e datablocks are in t%e NORMAL

    mode3

    '& (elect t%e A+T!ON4E0it men$

    selection&)& +lick t%e E0it tool on t%e toolb

    *& -ress t%e appropriate f$nction k

    +ontrol71 for client.ser#er and

    for /eb&

    ENTER QUERY

    mode

    Eit%er of t%e t"o 1$ery messaes

    are displayed&

    QUERY mode 2e0ec$tin t%e

    1$ery and placin t%e data

    block in t%e NORMAL mode3

    '& (elect t%e Q$ery4E0ec$te men$

    selection&

    )& +lick t%e E0ec$te Q$ery tool o

    toolbar&*& -ress t%e appropriate f$nction k

    58 for client.ser#er and +ontro

    for /eb&

    QUERY mode No records are displayed and t%e1$ery messae is not displayed or

    records are displayed in t%e datablock&

    NORMAL mode "it% norecords displayed&

    '& (elect t%e Q$ery4+ancel men$selection&

    )& +lick t%e +ancel Q$ery tool ontoolbar&

    *& -ress t%e appropriate f$nction k

    +ontrol71 for client.ser#er and

    for /eb&,& +lick t%e /indo"s +lose tool

    $pper.ri%t corner of t%e "indo

    Filtering ecords From a Database )sing a Form

    6ow that ou 7now how to eecute a /uer and return records to the data loc7' it is time to

    learn how to enter arguments "or the /uer!s )8E1E clause. -he most cle#er part o" an Oracle"orm is its ailit to accept sophisticated search arguments. Each item in the data loc7 canecome an argument in the )8E1E clause o" the SE2EC- statement issued the data loc7. Itis possile to enter a #alue o" Khalil and a #alue o" SJ into the "orm. )hen the /uer is eecuted'the "orm created the "ollowing )8E1E clause and added it to the issued SE2EC- statement*

    )here 2name LKhalil! And Fname li7e LAJ!

    -he result o" the "orm action was to retrie#e emploee records that had an emploee 2ast31

  • 8/11/2019 Introduction to Oracle Forms Builder

    32/34

    name +2name, #alue o" Khalil and a 5o that started with the character S. an "orm item thatcontains a #alue is added to the )8E1E clause' and an item that has a lan7 or 6U22 #alue isomitted. -hus' i" ou want to return all records' do not place an arguments into the "orm.

    An Oracle "orm also allows ou to emplo all o" the operators and "unctions that are

    a#ailale in Oracle S;2. ou can enter operators such as* 3' M' N' 6O-' 2IKE' or I6. ou can also

    emplo an o" Oracle!s arra o" "unctions such as* SUBS-1' ?O6-8SBE-)EE6-O6U?BE1' SOU6DEP' 2E6@-8' or U44E1. In "act' ou can e#en enter a SE2EC-statement as a #alue. -he "orm will use this as a su/uer or a correlated /uer in its issuedSE2EC- statement. I" entering #alues into a tet item is not con#enient' or the data source talehas columns not contained in the data loc7' ou can launch an editor that alows ou to write alonger argument and additional conditions. ou can use the And and Or 7ewords to createcomple search criteria as needed.

    )sing #erators in a Forms &earch 0alues

    In pre#ious section' it was noted that arguments can e entered directl into a displaed

    item when the data loc7 is in the E6-E1 ;UE1 mode. )hen this happens' Oracle uses ane/ual sign +, as the e#aluation operator. Sometimes it would e hand to use a di""erente#aluation operator' ut this a prolem. I" the argument is M L?! +greater than ?, were entereddirectl into a tet item' the SE2EC- statement would not recogni9e the greater than sign +M, asan operator. It would consider it a #alue. -he )8E1E clause would loo7 similar to this*

    )here Fname LM L?!!

    -he /uer will proal not return a #alue. -he Q smol mechanism is needed to tell the

    "orm that the inputted #alue contains an operator. )hen ou enter this smol as the "irstcharacter o" the #alue' Oracle treats the "ollowing epression as )8E1E clause condition ratherthan literal #alues. For eample' to retrie#e all emploee records with an emploee name +ename,

    #alue greater than or e/ual to ?' enter the "ollowing into the Fname tet item* Q M L?!. -hiscreates the "ollowing )8E1E clause*

    )here Fname M L?!

    32

  • 8/11/2019 Introduction to Oracle Forms Builder

    33/34

    )sing the Text Items Editor

    Entering the #alues directl into the tet item can e cumersome. E#en though the /uer

    length is long' the #iewing width o" the tet item will not match this length. -he user will not e ale

    to see the entire condition. Forms Builder!s -et Items Editor can e called to enter sophisticatedsearch arguments. -his can e easier to use than entering search arguments into a tet item'ecause ou can see the entire epression. -o launch the editor' place our cursor into an o" thedata loc7 items while it is in the E6-E1 ;UE1 mode and per"orm one o" the "ollowing steps*

    Clic7 the Edit:Edit menu option.

    4ress the appropriate "unction 7e* ControlE "or oth client(ser#er and )e.

    33

  • 8/11/2019 Introduction to Oracle Forms Builder

    34/34

    )sing the 'uer$%Where Dialog Box

    An Oracle has one other tool that ou can use to "ilter the records ' the ;uer:)here dialogo. It is used to write the Entire SE2EC- statement )8E1E clause. -his tool is launched *

    4lacing an +&, into an o" the tet items' and

    Eecuting the /uer.


Recommended