Sie sind auf Seite 1von 34

Oracle Reports Report: A report is a collection of objects that defines its data, layout and interface at runtime.

Oracle Reports Environment Variables: REPORTS60 PAT! "# #$O% ORA$&E PAT! 'indo(s %T)*+, modify in Re-istry Parameters are Two Types:

System Parameters "ser./efined Parameters

System Parameters: 0. 3. 4. 5. +. 6. 6. 7. *. 00. 00. 1ac2-round $opies $urrency /ecimal Thousands /esformat /esname /estype 8ode Orientation Printjob

System Parameters Purpose: System Parameter $OP#ES

Purpose

Default Value

Value

#s the number of report copies that Ta2en from the #nitial 9alue property of Any :alid inte-er from 0 throu-h should be made (hen the report is the $OP#ES parameter. *,***. printed. #s the symbol for the decimal indicator ;e.-., <.<=. #s the definition of the output de:ices format ;e.-., landscape mode for a printer=. This parameter is used (hen runnin- a report in a character.mode en:ironment, and (hen sendin- a bitmap report to a file ;e.-. to create P/? or !T8& output=. #s the type of de:ice to (hich to send the report output ;screen, file, mail, printer, or screen usin-PostScript format=. #s the name of the output de:ice ;e.-., the file name, printers The default for ORA$&E is determined by the ORA$&E %ational &an-ua-e Support facilities. >ou can also set a Any :alid alphanumeric character. default in the #nitial 9alue property for the /E$#8A& parameter. Ta2en from the #nitial 9alue property of the /ES?OR8AT parameter. ?or bit. P/? mapped Report 1uilder, !T8& if/ES?OR8AT is blan2 or dflt, then !T8&$SS the current printer dri:er ;specified in !T8&$SS#E ?ile $hoose Printer= is used.#f nothin- RT? has been selected in $hoose Printer, /E&#8#TE/ then Postscript is used by default. ?#&E, PR#%TER, Ta2en from the #nitial 9alue property of S$REE%, the /EST>PE parameter. 8A#&, PER9#E'. Ta2en from the #nitial 9alue property of Any :alid filename, printer name, or the /ES%A8E parameter. #f email #/ not to e@ceed 0A in len-th.

/E$#8A&

/ES?OR8AT

/EST>PE

/ES%A8E

name, mail userid=.

?or printer names, you can /EST>PEB?#&E and /ES%A8E is an optionally specify a port. ?or empty strin-, it defaults to report name e@ample, at runtime. /ES%A8EBprinter,&PT0, /ES%A8EBprinter, ?#&E,

8O/E OR#E%TATT#O%

#s (hether the report should run in character mode or bitmap. #s the print direction for the report /efault ;landscape, portrait, default=. /efault &andscape,Portrait

T!O"SA%/S

The default for ORA$&E is determined by the ORA$&E %ational &an-ua-e #s the symbol for the thousands Support facilities. >ou can also set a Any :alid alphanumeric character. default of up to four characters in the indicator ;e.-., <,<=. #nitial 9alue property of the T!O"SA%/S parameter. #s (hether the report should run in the fore-round or the bac2-round. #s the symbol for the currency indicator ;e.-., <D<=. #s (hether the Print Eob dialo- bo@ should appear before the report is run.

1A$ACRO"%/ $"RRE%$> PR#%TEO1

Report Types:


Tabular:

Tabular ?orm li2e ?orm &etter 8ailin- &abel Croup Abo:e Croup &eft 8atri@ 8atri@ (ith Croup

#t is most basic type of report (here each column corresponds to a column selected from the database. Form-like: #t is a report one record per pa-e. The field :alues are placed to the field labels. ailin! "abel: A 8ailin- label report prints mailin- labels in multiple column on each pa-e. The printin- can be a &andscape or a Portrait. Form "etter: A ?orm &etter reports contains database :alues embedded into any te@t that is entered or imported into the report editor. #roup "eft: A Croup &eft report di:ides the ro(s of a table into sets, based on a common :alue in each of the columns. This style is used to restrict a column from repeatin- the same :alue se:eral times (hile :alues of related columns chan-e. #roup $bove:

A Croup Abo:e report contains t(o or more -roups of data. ?or e:ery :alue of the master -roup, the related :alues of the detail -roup;s= are fetched from the database. atri%: A 8atri@ ;$ross Tab= report contains one ro( of tables, one column of labels and information in -rid format that is related to the ro( and column labels. A distin-uished feature of matri@ report is that the number of columns is not 2no(n until the data is fetched from the database. To create a 8atri@ report, at least four -roups are reFuired. One -roup must be cross.product -roup, t(o of the -roups must be (ith in the cross product -roup to furnish the labels, and at least one -roup must pro:ide the information to fill the cells. The -roups can pro:ide to a sin-le Fuery or to multiple Fueries. atri% wit& #roup: A matri@ (ith -roup report is a -roup abo:e report (ith a separate matri@ for each of the master -roup. atri% Report: To create a matri@ report, you need at least four -roups, one -roup must be a cross.product -roup, t(o of the -roups must be (ithin the cross.product -roup to furnish the <labels,< and at least one -roup must pro:ide the information to fill the cells. The -roups can belon- to a sin-le Fuery or to multiple Fueries. T&e or'er of events w&en a report is e%ecute' is as follows: 0. 1efore Parameter ?orm tri--er is fired. 3. Runtime Parameter ?orm appears ;if not suppressed=. 4. After Parameter ?orm tri--er is fired ;unless the user cancels from the Runtime Parameter ?orm=. 5. Report is <compiled.< +. Gueries are parsed. 6. 1efore Report tri--er is fired. 6. SET TRA%SA$T#O% REA/O%&> is e@ecuted ;if specified :ia the REA/O%&> ar-ument or settin-=. 7. The report is e@ecuted and the 1et(een Pa-es tri--er fires for each pa-e e@cept the last one. ;%ote that data can be fetched at any time (hile the report is bein- formatted.= $O88#Ts can occur durin- this time due to any of the follo(in-..user e@it (ith //&, SR'./O SG& (ith //&, or if O%?A#&"REB$O88#T, and the report fails. *. $O88#T is e@ecuted ;if REA/O%&> is specified= to end the transaction. 00. After Report tri--er is fired. 00. $O88#T)RO&&1A$A)%OA$T#O% is e@ecuted based on (hat (as specified :ia the O%S"$$ESS Tri!!ers in Reports an' Se(uence:

1efore Parameter ?orm After Parameter ?orm 1efore Report 1et(een Pa-es After Report

)efore Parameter Form: 1efore Parameter ?orm ?ires before the Runtime Parameter ?orm is displayed. ?rom this tri--er, you can access and chan-e the :alues of parameters, P&)SG& -lobal :ariables, and report.le:el columns. #f the Runtime Parameter ?orm is suppressed, this tri--er still fires. $onseFuently, you can use this tri--er for :alidation of command line parameters. $fter Parameter Form: After Parameter ?orm ?ires after the Runtime Parameter ?orm is displayed. ?rom this tri--er, you can access parameters and chec2 their :alues. This tri--er can also be used to chan-e parameter :alues or, if an error occurs, return to the Runtime Parameter ?orm. $olumns from the data model are not accessible from this tri--er. #f the Runtime Parameter ?orm is suppressed, the After Parameter ?orm tri--er still fires. $onseFuently, you can use this tri--er for :alidation of command line parameters or other data.

)efore Report:

1efore Report ?ires before the report is e@ecuted but after Fueries are parsed. )etween Pa!es: 1et(een Pa-es ?ires before each pa-e of the report is formatted, e@cept the :ery first pa-e. This tri--er can be used for customiHed pa-e formattin-. #n the Pre:ie(er, this tri--er only fires the first time that you -oes to a pa-e. #f you subseFuently return to the pa-e, the tri--er does not fire a-ain. $fter Report: After Report ?ires after you e@it the Pre:ie(er, or after report output is sent to a specified destination, such as a file, a printer, or an Oracle Office userid. This tri--er can be used to clean up any initial processin- that (as done, such as deletintables. %ote, ho(e:er, that this tri--er al(ays fires, (hether or not your report completed successfully. *n Oracle Reports w&at is Fle% o'e On+Off,

On: parent borders <stretch< (hen child objects are mo:ed a-ainst them. Off: parent borders remain fi@ed (hen child objects are mo:ed a-ainst them. -&at is t&e Difference between Repeatin! Frame an' Frame, Repeatin! Frame: The repeatin- frame is fired once for each record of the -roup. Frame: The frame is fired only once. $nc&or in Reports: Anchors are used to determine the :ertical and horiHontal positionin- of a child object relati:e to its parent. Since the siHe of some layout objects may chan-e (hen the report runs ;and data is actually fetched=, you need anchors to define (here you (ant objects to appear relati:e to one another. An anchor defines the relati:e position of an object to the object to (hich it is anchored. Positionin- is based on the siHe of the objects after the data has been fetched rather than on their siHe in the editor. #t should also be noted that the position of the object in the &ayout editor effects the final position in the report output. Any physical offset in the layout is incorporated into the percenta-e position specified in the Anchor property sheet. Summary .olumn: A summary column performs a computation on another columnIs data. "sin- the Report 'iHard or /ata 'iHard, you can create the follo(in- summaries, sum, a:era-e, count, minimum, ma@imum, J total. >ou can also create a summary column manually in the /ata 8odel :ie(, and use the Property Palette to create the follo(in- additional summaries, first, last, standard de:iation, :ariance. Formula .olumn: A formula column performs a user.defined computation on another column;s= data, includin- placeholder columns. ?ormula $olumns should not use to set :alues for the Parameters. Place&ol'er .olumn: A placeholder is a column for (hich you set the data type and :alue in P&)SG& that you define. >ou can set the :alue of a placeholder column in the follo(in- places,

the 1efore Report Tri--er, if the placeholder is a report.le:el column a report.le:el formula column, if the placeholder is a report.le:el column a formula in the placeholderIs -roup or a -roup belo( it ;the :alue is set once for each record of the -roup=

Format Tri!!er:

A format tri--er is a P&)SG& function e@ecuted before an object is formatted. A tri--er can be used to dynamically chan-e the formattin- attributes of the object. The function must return a 1oolean :alue ;TR"E or ?A&SE=. /ependin- on (hether the function returns TR"E or ?A&SE, the current instance of the object is included or e@cluded from the report output. >ou can access format tri--ers from the Object %a:i-ator, the Property Palette, or the P&)SG& Editor. /ote 0: ?ormat tri--ers do not affect the data retrie:ed by the report. ?or e@ample, if a format tri--er returns ?A&SE for a field, the data for the field is retrie:ed e:en thou-h the field does not appear in the output. /ote 1: #f a format tri--er suppresses report output on the last pa-e of the report, the last pa-e (ill still be formatted and sent to the appropriate output and the pa-e (ill be included in the total number of pa-es. Vali'ation Tri!!er: 9alidation tri--ers are P&)SG& functions that are e@ecuted (hen parameter :alues are specified on the command line and (hen you accept the Runtime Parameter ?orm. ;%otice that this means each :alidation tri--er may fire t(ice (hen you e@ecute the report.= 9alidation tri--ers are also used to :alidate the #nitial 9alue property of the parameter. The function must return a 1oolean :alue ;TR"E or ?A&SE=. /ependin- on (hether the function returns TR"E or ?A&SE, the user is returned to the Runtime Parameter ?orm. >ou can access :alidation tri--ers from the Object %a:i-ator, the P&)SG& Editor, or the Property Palette ;9alidation Tri--er property=. Definition "evel: parameter On Failure: user is returned to the parameter :alue in the Runtime Parameter ?orm (here they can either chan-e it or cancel the Runtime Parameter ?orm. $ction Tri!!er: Description Action tri--ers are P&)SG& procedures e@ecuted (hen a button is selected in the Runtime Pre:ie(er. The tri--er can be used to dynamically call another report ;drill do(n= or e@ecute any other P&)SG&. >ou can access action tri--ers from the Object %a:i-ator, the Property Palette ;P&)SG& Tri--er property=, or the P&)SG& Editor. Definition "evel: button 2sa!e /otes:

P&)SG& action tri--ers cannot be tested in the &i:e Pre:ie(er because the buttons are not acti:e there. >ou must use the Runtime Pre:ie(er ;choose 9ie( Runtime Pre:ie( from the &i:e Pre:ie(er=. >ou cannot use the P&)SG& #nterpreter to debu- action tri--ers because it is not a:ailable from the Runtime Pre:ie(er and buttons cannot be acti:ated in the &i:e Pre:ie(er. To -et around this, you can mo:e your action tri--er code to a report tri--er to test it from the &i:e Pre:ie(er.

$ction tri!!er e%ample: )K 'hen the button is clic2ed, the action tri--er defined by this procedure displays the Parameter ?orm for a report named (eb5.rdf, then displays the resultin- report output on your screen.K) Procedure " 01uttonAction is 1e-in Sr(.run report;moduleB(eb5.rdf destypeBScreen paramformByes=L EndL

"e%ical references:

&e@ical references are placeholders for te@t that you embed in a SE&E$T statement. >ou can use le@ical references to replace the clauses appearin- after SE&E$T, ?RO8, '!ERE, CRO"P 1>, OR/ER 1>, !A9#%C, $O%%E$T 1>, and START '#T!. >ou create a le@ical reference by enterin- an ampersand ;M= follo(ed immediately by the column or parameter name. A default definition is not pro:ided for le@ical references. Therefore, you must do the follo(in-,

1efore you create your Fuery, define a column or parameter in the data model for each le@ical reference in the Fuery. ?or columns, you must enter 9alue if %ull, and, for parameters, you must enter #nitial 9alue. Report 1uilder uses these :alues to :alidate a Fuery (ith a le@ical reference. $reate your Fuery containin- le@ical references.

E@, SE&E$T MP E%A8E %A8E, MP E8P%O E%O, MP EO1 RO&E ?RO8 MTable name )in' references + )in' Variables: 1ind references ;or bind :ariables= are used to replace a sin-le :alue in SG& or P&)SG&, such as a character strin-, number, or date. Specifically, bind references may be used to replace e@pressions in SE&E$T, '!ERE, CRO"P 1>, OR/ER 1>, !A9#%C, $O%%E$T 1>, and START '#T! clauses of Fueries. 1ind references may not be referenced in ?RO8 clauses or in place of reser:ed (ords or clauses. >ou create a bind reference by enterin- a colon ;,= follo(ed immediately by the column or parameter name. #f you do not create a column or parameter before ma2in- a bind reference to it in a SE&E$T statement, Report 1uilder (ill create a parameter for you by default. 3ow to perform DD" Statements in Oracle Reports, "sin- sr(.do sFl, u can perform //& Statements. -e cannot use E%ecute imme'iate in Oracle Reports. E@, sr(.do sFl ;I$reate table jdm test ;p empno %umber, p ename 9archar3 ;50=, p sal %umber=I=L 3ow to run a report wit& in a Report, "sin- Sr(.run report E@, sr(.run report;ImoduleB(eb5.rdf destypeBScreen paramformByesI=L SR-4DO5S6"5F$*"2RE: )K Suppose you (ant your o(n error messa-e raised, KK instead of the default error messa-e. KK >ou could handle this e@ception in the follo(in- (ay, K) EN$EPT#O% (hen SR'./O SG& ?A#&"RE then sr(.messa-e;0000, IError occurred (hile creatintable $!E$AS.I=L -&at are t&e 'ifferent "ayout ob7ects, Frames ?rame surrounds other layout objects, enablin- control of multiple objects simultaneously, ensurin- that they maintain their positions relati:e to each other in the report. A frame mi-ht be used to surround all objects o(ned by a -roup to surround column labels. ?rame fires only once. Repeatin! Frames Repeatin- frames act as placeholder for -roups ;repeatin- :alues= and present ro(s of data retrie:ed from the database. The repeatin- frame is fired once for each record of the -roup.

Fiel's ?ields act as placeholder for column :alues. They define the formattin- attributes for all columns displayed in the report. A field is one of the objects that can be located inside a frame or repeatin- frame. )oilerplates 1oilerplates consist of te@t and -raphics that appear in a report each time it is run. E@, A leabl appearin- abo:e a column of data is 1oiler te@t. Craphics dra(n in the layout as (ell as te@t added to the layout are boilerplate. -&at is 'ata mo'el, specify the data for the report, a data model should be defined. A data model is composed of some or all of the follo(indata definition objects. 04 6uery Gueries are A%S#.standard SG& Select statements that fetch data from a standard database such as Oracle, /13 etc. These select statements are fired each time the report is run. >ou can select any number of Fueries to select data from any number of tables. 14 #roups Croups determine the hierarchy of data appearin- in the report and are primarly used to create brea2s in the report. Oracle report automatically creates a -roup for each Fuery, but you are not limited to this default. >ou can create a ne( -roup in the data model and included a column that you (ant ti use as the brea2 column. 84 .olumn $olumn contains the data :alues for a report. /efault report columns, correspondin- to the tables included in the Fuerys SE&E$T list are automatically created by the table, Oracle Report, then each column is replaced in the -roup associated (ith the Fuery that selected the column. #f you (ant to perform summaries and computations on the database column :alues you can create ne( columns. >ou can also reassi-n one or more columns to a -roup you ha:e created. 94 Parameters Parameters are :isible for your report that enables you to chan-e selection criteria at runtime. Oracle report automatically creates a set of System Parameters a t runtime, but you can create your o(n as (ell. >ou can create parameters to replace either sin-le literal :alues or entire e@pressions in any part of a Fuery. >ou can reference parameters else(here in the report such as P&)SG& constructs pro:idin- conditional lo-ic for the report. :4 Data "ink /ata &in2 is used to establish parent.child relationship bet(een Fueries and -roups :ia column matchin-. -&at is #roup Filter, A -roup filter is a P&)SG& function that determines (hich records to include in a -roup, if the ?ilter Type property is P&)SG&. The function must return a boolean :alue ;TR"E or ?A&SE=. Ependin- on (hether the function returns TR"E or ?A&SE, the current record is included or e@cluded from the report. >ou can access -roup filters from the Object %a:i-ator, the Property Palette ;the P&)SG& ?ilter property=, or the P&)SG& Editor. Definition "evel: -roup On Failure: E@cludes the current record from the -roup. #roup filter e%ample function filter comm return boolean is be-in

if ,comm #S %OT %"&& then if ,comm O 000 then return ;?A&SE=L else return ;TR"E=L end ifL else return ;?A&SE=L .. for ro(s (ith %"&& commissions end ifL endL #roup filter Restrictions

Croup filters cannot be added to -roups if ?ilter Type is ?irst or &ast. Croup filters cannot be added to cross.product -roups. #n a -roup filters, you can read the :alues of Report 1uilder columns and parameters of the correct freFuency ;loo2 at the rule belo(=, but you cannot directly set their :alues. ?or e@ample, you can use the :alue of a parameter called $O"%T0 in a condition ;e.-., #? ,$O"%T0 B 00=, but you cannot directly set its :alue in an assi-nment statement ;e.-., ,$O"%T0 B 00=. %ote also that the use of P&)SG& -lobal :ariables to indirectly set the :alues of columns or parameters is not supported. #f you do this, you may -et unpredictable results. >ou also cannot reference any pa-e. dependent columns ;i.e., Reset At of Pa-e= or columns that rely on pa-e.dependent columns in a -roup filter. The function that you enter for a -roup filter can only depend upon the follo(in- columns, 1. A database column o(ned by the -roups Fuery or a Fuery abo:e it in the data 8odel hierarchy 2. $omputed columns ;formulas or summaries= that depend on unrelated Fueries ;i.e., computed columns that do not depend upon columns in the -roup, the -roups ancestors, or the -roups descendants=

Oracle Reports ;4< Fle%fiel' Support $P*: "sin- Oracle Applications fle@fields routines (ith Oracle Reports, you can build reports that display fle@fields data easily and in a number of (ays,

/isplay any indi:idual se-ment :alue, prompt, or description. /isplay se-ment :alues, prompts, or descriptions from multiple fle@field structures ;or conte@ts= in the same report. /isplay se-ment :alues, prompts, or descriptions from different fle@fields in the same report. /isplay t(o or more fle@field se-ment :alues, prompts, or descriptions, concatenated (ith delimiters, in the correct order. This includes description information for dependent, #ndependent, and table :alidated se-ments. Restrict output based upon a fle@field ran-e ;lo( and hi-h :alues=. Pre:ent reportin- on fle@field se-ments and :alues that users do not ha:e access to ;fle@field :alue security=. Specify order by, -roup by, and (here constraints usin- one or more, or all se-ment columns.

Oracle Reports an' Fle% fiel's Report-ritin! Steps:

Step 0: Define your )efore Report Tri!!er =t&is step is always t&e same> >ou al(ays call ?%/ SR'#%#T from the 1efore Report Tri--er, SR'."SER EN#T ;?%/ SR'#%#T=L This user e@it sets up information for use by fle@ fields, user profiles, the concurrent mana-er, and other Oracle Applications features. >ou must include this step if you use any Oracle Application Object &ibrary features in your report ;such as concurrent processin-=. Step 1: Define your $fter Report Tri!!er =t&is step is always t&e same> >ou al(ays call ?%/ SR'EN#T from the After Report Tri--er, SR'."SER EN#T ;?%/ SR'EN#T=L This user e@it frees all the memory allocation done in other Oracle Applications user e@its. >ou must include this step if you use any Oracle Application Object &ibrary features in your report ;such as concurrent processin-=.

Step 8: Define your re(uire' parameters >ou define the parameters your report needs by usin- the /ata 8odel Painter. >ou use these parameters in the user e@it calls and SG& statements.

>ou must al(ays create the P $O%$ REG"EST #/ le@ical parameter. ?%/ SR'#%#T uses this parameter to retrie:e information about the concurrent reFuest that started this report. The P ?&EN/ATA parameter holds the SE&E$T fra-ment of the SG& Fuery. The initial :alue is used to chec2 the :alidity of a Fuery containin- this parameter and to determine the (idth of the column as specified by the column alias. #ts initial :alue is some strin- that contains columns (ith a cumulati:e (idth more than the e@pected (idth reFuired to hold the data. 8a2e sure the (idth of this column is sufficient. #f there are total 40 se-ments in the table then the safest initial :alue (ill be, ;SEC8E%T0PPQnPPSEC8E%T3PPQnPPSEC8E%T4 ... SEC8E%T40= >ou determine the (idth by determinin- the len-th of that strin-. That len-th is rou-hly the number of characters in the table alias plus the len-th of the column name, times the number of se-ments your code combinations table contains, times the number of structures you e@pect,plus more for delimiter characters as sho(n in the strin- abo:e. Step 9: Define your ot&er parameters >ou define the rest of the parameters your report needs by usin- the /ata 8odel Painter. >ou use these parameters in the user e@it calls and SG& statements.

Step : : .all F/D F"E?S6" from your )efore Report Tri!!er to populate P5F"E?D$T$ %e@t, -i:en that you (ant to display fle@field information li2e concatenated :alues and descriptions, and arran-e them in order, you ma2e one call to ?%/ ?&ENSG& from the 1efore Report Tri--er specifyin- the le@ical parameters. This call chan-es the :alue of the le@ical parameter P ?&EN/ATA at runtime to the SG& fra-ment that selects all fle@fields :alue data. ?or e@ample, the parameter chan-es to ;SEC8E%T0PPQnPPSEC8E%T3PPQnPPSEC8E%T4PPQnPPSEC8 E%T5=. 'hen you incorporate this le@ical parameter into the SE&E$T clause of a Fuery, it enables the Fuery to return the concatenated se-ment :alues that are needed as input to other AO& user e@its. These e@its then retrie:e the actual fle@field information for display purposes.

!ere is an e@ample ?%/ ?&ENSG& call. %otice that the ar-uments are :ery similar to other fle@field routine callsL $O/EB and %"8B desi-nate the 2ey fle@field and its structure, respecti:ely. ?or a report on a different 2ey fle@field ;such as the System #tems fle@field=, you (ould use a different $O/E and %"8. SR'.RE?ERE%$E;,P STR"$T %"8=L SR'."SER EN#T;?%/ ?&ENSG& $O/EBC&R %"8B,P STR"$T %"8 APP& S!ORT %A8EBSG&C& O"TP"TB,P ?&EN/ATA 8O/EBSE&E$T /#SP&A>BA&&=L >ou should al(ays reference any source column)parameter that isused as a source for data retrie:al in the user e@it. This -uarantees that this column)parameter (ill contain the latest :alue and is achie:ed by SR'.RE?ERE%$E call as sho(n abo:e. Step ;: .all F/D F"E?S6" from your )efore Report Tri!!er to populate ot&er parameters >ou call ?%/ ?&ENSG& once for e:ery le@ical parameter such as P '!ERE or P OR/ER1>. Step @: Define your report (uery or (ueries /efine your report Fuery G 0, SE&E$T MP ?&EN/ATA $ ?&EN/ATA ?RO8 $O/E $O81#%AT#O%S TA1&E '!ERE $O/E $O81#%AT#O%S TA1&E.STR"$T"RE /E?#%#%C $O&"8% B MP STR"$T %"8 The Fuery fetches the data reFuired to be used as input for the ?&EN#/9A& user e@it later. %ote, Al(ays pro:ide a column alias ;$ ?&EN/ATA in this e@ample= in the SE&E$T clause that is the name of column. This name of the column is reFuired in ?%/ ?&EN#/9A&. 'hen the report runs, the call to ?%/ ?&ENSG& fills in the le@ical parameters. As a result the second Fuery (ould loo2 somethin- li2e, SE&E$T ;SEC8E%T0PPPPSEC8E%T3PPPPSEC8E%T4PPPP SEC8E%T5= $ ?&EN/ATA ?RO8 $O/E $O81#%AT#O%S TA1&E '!ERE $O/E $O81#%AT#O%S TA1&E.STR"$T"RE /E?#%#%C $O&"8% B 000 Step A: .reate formula columns %o( create columns $ ?&EN?#E&/ and $ /ES$ A&& ;and any others your report uses= correspondin- to the :alues and descriptions displayed in the report. They all are in -roup C 0. 1e sure to adjust the column (idth as appropriate for the :alue the column holds ;such as a prompt, (hich mi-ht be as lon- as 40 characters=. $ttention: "se (ord(rappin- for fle@field columns if necessary to a:oid possible truncation of your :alues. /o this by settin- SiHin- to E@pand. Step B: Populate se!ment values formula column To retrie:e the concatenated fle@field se-ment :alues and description, you incorporate the fle@fields user e@its in these columns. #n the column definition of $ ?&EN?#E&/, you incorporate the ?%/ ?&EN#/9A& user e@it call in the formula field. >ou pass the concatenated se-ments alon- (ith other information to the user e@it, and the user e@it populates the concatenated :alues in this column as specified by the 9A&"E to2en. A typical call to populate se-ment SR'.RE?ERE%$E;,P STR"$T %"8=L SR'.RE?ERE%$E;,$ ?&EN/ATA=L

SR'."SER EN#T;?%/ ?&EN#/9A& $O/EBC&R %"8B,P STR"$T %"8 APP& S!ORT %A8EBSG&C& /ATAB,$ ?&EN/ATA 9A&"EB,$ ?&EN?#E&/ /#SP&A>BA&&=L RET"R%;,$ ?&EN?#E&/=L Step 0<: Populate se!ment 'escriptions To populate the se-ment description use /ES$R#PT#O%B$ /ES$ A&& instead of 9A&"EB$ ?&EN?#E&/ as in the pre:ious call. The user e@it call becomes, SR'.RE?ERE%$E;,P STR"$T %"8=L SR'.RE?ERE%$E;,$ ?&EN/ATA=L SR'."SER EN#T;?%/ ?&EN#/9A& $O/EBC&R %"8B,P STR"$T %"8 APP& S!ORT %A8EBSG&C& /ATAB,$ ?&EN/ATA /ES$R#PT#O%B,$ /ES$ A&& /#SP&A>BA&&=L RET"R%;,$ /ES$ A&&=L >ou ha:e created parameters and columns that are containers of all the :alues to be displayed. %o(, in the follo(in- steps, you create the layout to display these :alues on the report. Step 00: .reate your 'efault report layout "se the Report 'iHard to -enerate the default layout. /eselect $ ?&EN/ATA. Specify a &abel and a reasonable 'idth for the columns you (ant to display.

Oracle Reports ta2es you to the layout painter. Cenerate and run the report. Step 01: Finis& your report Adjust your report layout as needed.

0> -&at is Ref .ursor 6uery, Description: A ref cursor Fuery uses P&)SG& to fetch data for the report. #n a ref cursor Fuery, you specify a P&)SG& function that returns a cursor :alue from a cursor :ariable. Definition "evel: Fuery On Failure: %o data is returned to the Fuery. 2sa!e /otes

'hen you ma2e a ref cursor Fuery the child in a data lin2, the lin2 can only be a -roup to -roup lin2. #t cannot be a column to column lin2. #f you use a stored pro-ram unit to implement ref cursors, you recei:e the added benefits that -o alon- (ith storinyour pro-ram units in the Oracle database.

E%ample: set ser:eroutput on declare type t cursor is ref cursorL r cursor t cursorL t :al %umber ,B 3L c :al %umberL be-in if t :al B 0 then open r cursor for select no from t (here noB00L else

open r cursor for select num from t 0 (here numB000L end ifL fetch r cursor into c :alL dbms output.put line;I9alue ,IPPc :al=L close r cursorL e@ception (hen others then dbms output.put line;IError occurred ,IPPsubstr;sFlerrm,0,3+0==L endL ) Output , 9alue ,000 Packa!e wit& ref cursor e%ample: )K This pac2a-e spec defines a ref cursor type that could be referenced from a ref cursor Fuery function. #f creatin- this spec as a stored procedure in a tool such as SG&KPlus, you (ould need to use the $REATE PA$AACE command.K) PA$AACE c: #S type comp rec is RE$OR/ ;deptno number, ename :archar;00=, compensation number=L type comp c: is RE? $"RSOR return comp recL E%/L Packa!e wit& ref cursor an' function e%ample: )K This pac2a-e spec and body define a ref cursor type as (ell as a function that uses the ref cursor to return data. The function could be referenced from the ref cursor Fuery, (hich (ould -reatly simplify the P&)SG& in the Fuery itself. #f creatinthis spec and body as a stored Procedure in a tool such as SG&KPlus, you (ould need to use the $REATE PA$AACE and $REATE PA$AACE 1O/> commands.K) PA$AACE c: #S type comp rec is RE$OR/ ;deptno number, ename :archar;00=, compensation number=L type comp c: is RE? $"RSOR return comp recL function emprefc;deptno0 number= return comp c:L E%/L PA$AACE 1O/> c: #S function emprefc;deptno0 number= return comp c: is temp c: c:.comp c:L be-in if deptno0 S 30 then open temp c: for select deptno, ename, 0.3+K;salTn:l;comm,0== compensation from emp (here deptno B deptno0L else open temp c: for select deptno, ename, 0.0+K;salTn:l;comm,0== compensation from emp (here deptno B deptno0L end ifL return temp c:L endL E%/L 1> 3ow 'o you 'ebu! Report from Reports )uil'er, Tools.STrace

Specify tracin! options via t&e Report )uil'er built-in packa!e usin! SR'.TRA$E SR'.TRA$E SR'.TRA$E SR'.TRA$E START E%/ A// OPT#O%S RE8 OPT#O%S Synta% SR'.TRA$E START ;filename, USR'.TRA$E REP&A$E PSR'.TRA$E APPE%/V, SR'.TRA$EOPTS=L Parameter Description #s the name of the file in (hich Report 1uilder stores lo--in- #nformationW Adds the ne( information to the end of the file. Adds the ne( information to the end of the file. Applies the trace options mas2 pre:iously defined by SR'.TRA$EOPTS.8ASA.

Trace Option

SR'.TRA$E START

?ilename

SR'.TRA$E APPE%/ SR'.TRA$E REP&A$E SR'.TRA$EOPTS SR'.TRA$E E%/ SR'.TRA$E E%/;=L

SR'.TRA$EOPTS.8ASA ,B SR'.TRA$E opts SR'.TRA$E A// OPT#O% XT SR'.TRA$E opts . . .YL SR'.TRA$E A// OPT#O% ;SR'.TRA$EOPTS=L SR'.TRA$EOPTS.8ASA ,B SR'.TRA$E opts SR'.TRA$E RE8 OPT#O% XT SR'.TRA$E opts . . .YL SR'.TRA$E RE8 OPT#O% ;SR'.TRA$EOPTS=L

ask Option

Description

SR'.TRA$E A&& #ncludes all possible trace information in the lo- file. SR'.TRA$E APP #ncludes trace information on all the report objects in the lo- file. SR'.TRA$E 1RA &ists brea2points in the lo- file. SR'.TRA$E /ST &ists distribution lists in the lo- file. >ou can use this information to determine (hich section (as sent to (hich destination.

SR'.TRA$E ERR #ncludes error messa-es and (arnin-s in the lo- file. SR'.TRA$E P&S #ncludes trace information on all the P&)SG& objects in the lo- file. SR'.TRA$E PR? #ncludes performance statistics in the lo- file. SR'.TRA$E SG& #ncludes trace information on all the SG& in the lo- file 8> .an you &ave more t&an one layout in a Report, #t is possible to ha:e more than one layout in a report by usin- the additional layout option in the layout editor. 9> -&at is t&e "ock Option in t&e Report, 1y usin- the loc2 Option, (e cannot mo:e the fields in the &ayout Editor outside the frame. This is useful for maintainin- the fields. :> -&at is 'efaultin! 2nit of #nch ;> -&ic& Proce'ure 'isplays messa!e number an' Te%t you specify, SR'.8ESSACE;Number, Text=L @> 3ow many Types of .olumns are t&ere in Reports, ?ormula column, Summary $olumn and Placeholder $olumn. A> -&at is t&e inimum /umber of #roups re(uire' fro a atri% report, easure in Report,

8inimum 5 our Croups are reFuired for a matri@ Report. B> -&ic& of t&e followin! Options is vali' for Panel+Print Or'er Property in Report )uil'er, Across /o(n)/o(n Across 0<> .an "e%ical Reference be ma'e in P"+S6" Statement, %o 00> -&at is 2ser E%it *n Oracle Reports, A user e@it is a pro-ram that you (rite and then lin2 into the Report 1uilder e@ecutable or user e@it /&& files. >ou build user e@its (hen you (ant to pass control from Report 1uilder to a pro-ram you ha:e (ritten, (hich performs some function, and then returns control to Report 1uilder. "ser e@its can perform the follo(in- tas2s,

Perform comple@ data manipulation Pass data to Report 1uilder from operatin- system te@t files

8anipulate &O%C RA' data Support P&)SG& bloc2s $ontrol real time de:ices, such as a printer or a robot

>ou can use user e@its for other tas2s, such as mathematical processin-. !o(e:er, Oracle $orporation recommends that you perform such tas2s (ith P&)SG& (ithin Report 1uilder. >ou can (rite the follo(in- types of user e@its,

ORA$&E Precompiler user e@its O$# ;ORA$&E $all #nterface= user e@its %on.ORA$&E user e@its

>ou can also (rite a user e@it that combines both the ORA$&E Precompiler interface and the O$#. Precompiler Oracle 2ser E%it: An ORA$&E Precompiler user e@it incorporates the ORA$&E Precompiler interface. This interface supports the follo(in-,

>ou can (rite a subroutine in one of the host lan-ua-es ;Ada, $, $O1O&, ?ORTRA%, Pascal, P&)l= and embed SG& commands. The user e@it can access ORA$&E ;:ia embedded SG& commands= and Report 1uilder :ariables, parameters, and columns.

1ecause of these features, you (ill (rite most of your user e@its as ORA$&E Precompiler user e@its. O.* =Oracle .all *nterface> 2ser e%it: An O$# user e@it incorporates the ORA$&E $all #nterface. This interface allo(s you to (rite a subroutine that contains calls to ORA$&E. A user e@it that incorporates only the O$# ;and not the ORA$&E Precompiler interface= cannot access Report 1uilderI :ariables, parameters, and columns. /on-Oracle user e%it: A non.ORA$&E user e@it does not incorporate either the ORA$&E Precompiler interface or the O$#. ?or e@ample, a non. ORA$&E user e@it mi-ht be (ritten entirely in $. 1y definition, a non.ORA$&E user e@it cannot access ORA$&E or Report 1uilder :ariables, parameters, and columns. 01> -&y 'o we call F/D SR-*/*T user e%it from )efore Report Tri!!er, ?%/ SR'#%#T sets your profile option :alues and allo(s Oracle Application Object &ibrary user e@its to detect that an Oracle Reports pro-ram has called them. ?%/ SR'#%#T also allo(s your report to use the correct or-aniHation automatically. 08> -&y 'o we call F/D SR-E?*T user e%it from $fter Report Tri!!er, ?%/ SR'EN#T ensures that all the memory allocated for Oracle Application Object &ibrary user e@its has been freed up properly. 09> -&y 'o we call F/D F"E?S6" user e%it from )efore Report Tri!!er, F/D F"E?S6" : $all this user e@it to create a SG& fra-ment usable by your report to tailor your SE&E$T statement that retrie:es fle@field :alues. This fra-ment allo(s you to SE&E$T fle@field :alues or to create a '!ERE, OR/ER 1>, CRO"P 1>, or !A9#%C clause to limit or sort the fle@field :alues returned by your SE&E$T statement. >ou call this user e@it once for each fra-ment you need for your select statement. >ou define all fle@field columns in your report as type $!ARA$TER e:en thou-h your table may use %"81ER or /ATE or some other datatype. Synta%:

?%/ ?&ENSG& $O/EBZfle@field codeZ APP& S!ORT %A8EBZapplication short nameZ O"TP"TBZ,output le@ical parameter nameZ 8O/EBZU SE&E$T P '!ERE P !A9#%C P OR/ER 1>VZ X/#SP&A>BZUA&& P fle@field Fualifier P se-ment numberVZY XS!O'/EPSECBZU> P %VZY X%"8BZ,structure definin- le@icalZ P 8"&T#%"8BZU> P %VZY XTA1&EA&#ASBZcode combination table aliasZY XOPERATORBZU B P O P S P OB P SB P [B P ZPPZ P 1ET'EE% P G1EVZY XOPERA%/0BZ,input parameter or :alueZY XOPERA%/3BZ,input parameter or :alueZY .ODE: Specify the fle@field code for this report ;for e@ample, C&R=. >ou call ?&ENSG& multiple times to set up SG& fra-ments (hen reportin- on multiple fle@fields in one report. $PP"5S3ORT5/$ E: Specify the short name of the application that o(ns this fle@field ;for e@ample, SG&C&=. O2TP2T: Specify the name of the le@ical parameter to store the SG& fra-ment. >ou use this le@ical later in your report (hen defininthe SG& statement that selects your fle@field :alues. The datatype of this parameter should be character. ODE: Specify the mode to use to -enerate the SG& fra-ment. 9alid modes are, i> SE"E.T: Retrie:es all se-ments :alues in an internal ;non\displayable= format. #f you SE&E$T a fle@field Fualifier, and that fle@field se-ment is a dependent se-ment, then fle@fields automatically selects both the parent se-ment and the dependent se-ment. ?or e@ample, if the Fualifier references the Subaccount se-ment, then both the Account ;the parent= and the Subaccount se-ment columns are retrie:ed. /ote: >ou reuse the le@ical you use in the SE&E$T clause in the CRO"P 1> clause. ii> -3ERE: Restrict the Fuery by specifyin- constraints on fle@field columns. The fra-ment returned includes the correct decode statement if you specify 8"&T#%"8. >ou should also specify an OPERATOR and OPERA%/S. >ou can prepend a table alias to the column names usin- the TA1&EA&#AS to2en. iii> 3$V*/#: callin- procedure and functionality as '!ERE iv> ORDER )C: Order Fueried information by fle@field columns. The fra-ment orders your fle@field columns and separates them (ith a comma. The fra-ment returned includes the correct decode statement if you specify 8"&T#%"8.

>ou use the 8O/E to2en (ith the /#SP&A> to2en. The /#SP&A> to2en specifies (hich se-ments are included in your SG& fra-ment in your le@ical parameter. ?or e@ample, if your 8O/E is SE&E$T, and you specify /#SP&A>BZA&&Z, then your SE&E$T statement includes all se-ments of the fle@field. Similarly, if your 8O/E is '!ERE, and you specify /#SP&A>BZA&&Z, then your '!ERE clause includes all se-ments. ?reFuently you (ould not (ant all se-ments in your '!ERE clause, since the condition you specify for the '!ERE clause in your actual Fuery (ould then apply to all your se-ments ;for e@ample, if your condition is Z B 4Z, then SEC8E%T0, SEC8E%T3, ... , SEC8E%Tn (ould each ha:e to be eFual to 4=. v> S3O-DEPSE#: S!O'/EPSECBZ%Z disables automatic addition of depended upon se-ments to the order criteria. The default :alue is Z>Z. This to2en is :alid only for 8O/EBZOR/ER 1>Z in ?&ENSG&. vi> /2 or 2"T*/2 :

Specify the name of the le@ical or source column that contains the fle@field structure information. #f your fle@field uses just one structure,specify %"8 only and use a le@ical parameter to hold the :alue. #f your fle@field uses multiple structures, specify 8"&T#%"8 only and use a source column to hold the :alue. #n this case the user e@it builds a decode statement to handle the possible chan-in- of structures mid\report. The default is %"8BZ000Z. vii> T$)"E$"*$S : Specify the table alias you (ould li2e pretended to the column names. >ou use TA1&EA&#AS if your SE&E$T joins to other fle@field tables or uses a self\join. viii> OPER$TOR: Specify an operator to use in the '!ERE clause. The operators ZB P O P S P OB P SB P [B P G1E P 1ET'EE%Z perform le@ical comparisons, not numeric comparisons. 'ith G1E ;Guery 1y E@ample= and 1ET'EE% operators, the user can specify partial fle@field :alues to match for one or more se-ments. ?or e@ample, if OPERA%/0 is Z00\\$AJ\Z ;assumin- a four\se-ment fle@field (ith a delimiter of ]\]=, the first se-ment must match 00 and the third se-ment is li2e ]$AJ]. The resultin- SG& fra-ment is, SEC8E%T0B]00] A%/ SEC8E%T4 &#AE ]$AJ ?or the 1ET'EE% operator, if OPERA%/0 is Z00\\$A\Z and OPERA%/3 is Z0+\\8A\Z then the resultin- SG& fra-ment is, SEC8E%T0 1ET'EE% ]00] A%/ ]0+]= A%/ ;SEC8E%T4 1ET'EE% ]$A] A%/ ]8A]= i%> OPER$/D0: Specify an operand to use in the '!ERE clause. %> OPER$/D1: Specify a second operand to use (ith OPERATORBZ1ET'EE%Z. 0:> -&at is t&e use of F/D F"E?*DV$" user e%it, F/D F"E?*DV$": $all this user e@it to populate fields for display. >ou pass the 2ey fle@fields data retrie:ed by the Fuery into this e@it from the formula column. 'ith this e@it you display :alues, descriptions and prompts by passin- appropriate to2en ;any one of 9A&"E, /ES$R#PT#O%, APRO8PT or &PRO8PT=. Synta%: ?%/ ?&EN#/9A& $O/EBZfle@field codeZ

APP& S!ORT %A8EBZapplication short nameZ /ATABZ,source column nameZ X%"8BZ,structure definin- source column)le@icalZY X/#SP&A>BZUA&&Pfle@field FualifierPse-ment numberVZY X#/#SP&A>BZUA&&Pfle@field FualifierPse-ment numberVZY XS!O'/EPSECBZU> P %VZY X9A&"EBZ,output column nameZY X/ES$R#PT#O%BZ,output column nameZY XAPRO8PTBZ,output column nameZY X&PRO8PTBZ,output column nameZY XPA//E/ 9A&"EBZ,output column nameZY XSE$"R#T>BZ,column nameZY i> .ODE: Specify the fle@field code for this report ;for e@ample, C&R=. >ou call?&EN#/9A& multiple times, usin- a different $O/E, to display information for multiple fle@fields in one report. ii> $PP"5S3ORT5/$ E: Specify the short name of the application that o(ns this fle@field ;for e@ample, SG&C&=. iii> D$T$: Specify the name of the field that contains the concatenated fle@field se-ment :alues retrie:ed by your Fuery. iv> /2 : Specify the name of the source column or parameter that contains the fle@field structure information. v> D*SP"$C: The /#SP&A> parameter allo(s you to display se-ments that represent specified fle@field Fualifiers or specified se-ment numbers, (here se-ment numbers are the order in that the se-ments appear in the fle@field (indo(, not the se-ment number specified in the /efine Aey Se-ments form. The default is A&&, (hich displays all se-ments. Alternati:ely, you can specify a fle@field Fualifier name or a se-ment number. >ou can use these parameters as to--le s(itches by specifyin- them more than once. ?or e@ample, if you to display all but the first se-ment, you (ould specify, /#SP&A>BZA&&Z /#SP&A>BZ0Z vi> *D*SP"$C: >ou use this parameter to tell ?&EN#/9A& (hat se-ments you used in your SE&E$T clause in the correspondin- ?&ENSG& call. ?&EN#/9A& needs this information to determine the format of ra( data retrie:ed by ?&ENSG&. >ou set #/#SP&A> to the same :alue as your /#SP&A> parameter in your ?&ENSG& call. The default :alue is A&&, so if you used /#SP&A>BZA&&Z in ?&ENSG&, you do not need to use #/#SP&A> here vii> S3O-DEPSE# : S!O'/EPSECBZ%Z disables automatic display of depended upon se-ments. The default :alue is >. i%> V$"2E: Specify the name of the column in (hich you (ant to display fle@field :alues. %> DES.R*PT*O/ : Specify the name of the column in (hich you (ant to display fle@field descriptions.

%i> $PRO PT: Specify the name of the column in (hich you (ant to display fle@field abo:e prompts. %ii> "PRO PT: Specify the name of the column in (hich you (ant to display fle@field left prompts. %iii> P$DDED5V$"2E : Specify the name of the column in (hich you (ant to display padded fle@field :alues. The se-ment :alues are padded to the se-ment siHe (ith blan2s. %iv> SE.2R*TC : Specify the name of the column into (hich fla- ZSZ (ill be placed if the se-ment :alues are secured. >ou then (rite lo-ic to hide or display :alues based on this fla-. This to2en is applicable only for se-ment :alues and does not apply to description, left prompt or abo:e prompt. /ote: The datatype of the column as specified by 9A&"E, /ES$R#PT#O%, APRO8PT and &PRO8PT is $!ARA$TER. 0;> 3ow to implement Fle% fiel's in a Report, >ou use a t(o.step method to report on fle@field :alues. The first step creates the appropriate SG& statement dynamically based upon the user]s fle@field. The output of the first step is used as input to the second step. The second step formats this ra( data for display. Step 0 =.onstruction>: The first step reFuires you to include one or more le@ical parameters ;Oracle Reports :ariables that can be chan-ed at runtime= in your SG& statement. >ou call the user e@it ?%/ ?&ENSG& (ith different ar-uments to specify that part of the Fuery you (ould li2e to build. The user e@it retrie:es the appropriate column names ;SG& fra-ment= and inserts it into the le@ical parameter at runtime before the SG& Fuery is e@ecuted. The Fuery then returns site\ and runtime\specific fle@field information. ?or e@ample, suppose you ha:e the follo(in- Fuery, SE&E$T M&EN#$A&0 alias, column ?RO8 table '!ERE M&EN#$A&3 The preliminary calls to ?%/ ?&ENSG& replace :alues of &EN#$A&0and &EN#$A&3 at e@ecution time (ith the SG& fra-ments. ?or e@ample, &EN#$A&0 becomes ZSEC8E%T0PP]Qn]PPSEC8E%T3Z and &EN#$A&3 becomes ZSEC8E%T0 less than 3Z ;assumin- the user]s fle@field is made up of t(o se-ments and the user reFuested that the se-ment :alue of SEC8E%T0 be less than 3=. The actual e@ecuted SG& Fuery mi-ht be, SE&E$T SEC8E%T0PP]Qn]PPSEC8E%T3 alias, column ?RO8 table '!ERE SEC8E%T0 less than 3 The SG& statement for a user (ith a different fle@field structure mi-ht be, SE&E$T SEC8E%T+PP]Qn]PPSEC8E%T4PP]Qn]PPSEC8E%T7 alias, column ?RO8 table '!ERE SEC8E%T4 less than 3 'ith this step you can alter the SE&E$T, OR/ER 1>, CRO"P 1>, or '!ERE clause. >ou use this step to retrie:e all the concatenated fle@field se-ment :alues to use as input to the user e@it ?%/ ?&EN#/9A& in step 3 ;described belo(=. >ou call this user e@it once for each le@ical parameter you use, and you al(ays call it at least once to -et all se-ments. This ra( fle@field information is in an internal format and should ne:er be displayed ;especially if the se-ment uses a Zhidden #/Z :alue set=. Step 1 =Display>:

The second step reFuires you to call another user e@it, ?%/ ?&EN#/9A&, on a Zpost\recordZ basis. >ou create a ne( formula column to contain the fle@field information and include the user e@it call in this column. This user e@it determines the e@act information reFuired for display and populates the column appropriately. 1y usin- the fle@field routines the user e@it can access any fle@field information. "se this step for -ettin- descriptions, prompts, or :alues. This step deri:es the fle@field information from the already selected concatenated :alues and populates the formula column on a ro(.by.ro( basis. >ou call ?%/ ?&EN#/9A& once for each record of fle@field se-ments. The fle@field user e@its for Oracle Reports are similar to their Oracle Application Object &ibrary ;usin- SG&K?orms= counterparts &OA/#/;R= or &OA//ES$ and POP#/;R= or POP/ES$L one to construct or load the :alues ;?&ENSG&=, the other to display them ;?&EN#/9A&=. The to2en names and meanin-s are similar. )asic *mplementation Steps Step 0: .all F/D SR-*/*T from your )efore Report Tri!!er >ou call the user e@it ?%/ SR'#%#T from your 1efore Report Tri--er. ?%/ SR'#%#T fetches concurrent reFuest information and sets up profile options. >ou must include this step if you use any Oracle Application Object &ibrary features in your report ;such as concurrent processin-=. Step 1: .all F/D SR-E?*T from your $fter Report Tri!!er >ou call the user e@it ?%/ SR'EN#T from your After Report Tri--er. ?%/ SR'EN#T frees all the memory allocation done in other Oracle Applications user e@its. >ou must include this step if you use any Oracle Application Object &ibrary features in your report ;such as concurrent processin-=. Step 8: .all F/D F"E?S6" from t&e )efore Report Tri!!er >ou need to pass the concatenated se-ment :alues from the underlyin- code combinations table to the user e@it so that it can display appropriate data and deri:e any descriptions and :alues from s(itched :alue sets as needed. >ou -et this information by callin- the AO& user e@it ?%/ ?&ENSG& from the 1efore Report Tri--er. This user e@it populates the le@ical parameter that you specify (ith the appropriate column names)SG& fra-ment at run time. >ou include this le@ical parameter in the SE&E$T clause of your report Fuery. This enables the report itself to retrie:e the concatenated fle@field se-ment :alues. >ou call this user e@it once for each le@ical to be set. >ou do not display this column in your report. >ou use this Zhidden fieldZ as input to the ?%/ ?&EN#/9A& user e@it call. This user e@it can also handle multi\structure fle@field reportin- by -eneratin- a decode on the structure column. #f your report Fuery uses table joins, this user e@it can prepend your code combination table name alias to the column names it returns. SE&E$T M&EN#$A& alias, column 1ecomes, for e@ample, SE&E$T SEC8E%T0PP]Qn]PPSEC8E%T3 alias, column /ote: Oracle Reports needs the column alias to 2eep the name of column fi@ed for the le@icals in SE&E$T clauses. 'ithout the alias, Oracle Reports assi-ns the name of the column as the initial :alue of the le@ical and a discrepancy occurs (hen the :alue of the le@ical chan-es at run time. Step 9: Restrict report 'ata base' upon fle%fiel' values >ou call the user e@it ?%/ ?&ENSG& (ith 8O/EBZ'!EREZ from the 1efore Report Tri--er. This user e@it populates a le@ical parameter that you specify (ith the appropriate SG& fra-ment at run time. >ou include this le@ical parameter in the '!ERE clause of your report Fuery. >ou call this user e@it once for each le@ical to be chan-ed. #f your report Fuery uses table joins, you can ha:e this user e@it prepend your code combination table name alias to the column names it returns. '!ERE ta@ fla- B ]>] and M&EN#$A& less than Mreportinput 1ecomes, for e@ample, '!ERE ta@ fla- B ]>] and T0.se-ment4 less than 300 The same procedure can be applied for a !A9#%C clause. Step :: Or'er by fle%fiel' columns

>ou call the user e@it ?%/ ?&ENSG& (ith 8O/EBZOR/ER 1>Z from the 1efore Report Tri--er. This user e@it populates the le@ical parameter that you specify (ith the appropriate SG& fra-ment at run time. >ou include this le@ical parameter in the OR/ER 1> clause of your report Fuery. >ou call this user e@it once for each le@ical to be chan-ed. #f your report Fuery uses table joins, you can ha:e this user e@it prepend your code combination table name alias to the column names it returns. OR/ER 1> column0, M&EN#$A& 1ecomes, for e@ample, OR/ER 1> column0, se-ment0, se-ment4 Step ;:Display fle% fiel' se!ment valuesD 'escriptionsD an' prompts $reate a ?ormula $olumn ;an Oracle Reports 6.0 data construct that enables you to call a user e@it=. $all the user e@it ?%/ ?&EN#/9A& as the ?ormula for this column. This user e@it automatically fetches more complicated information such as descriptions and prompts so that you do not ha:e to use complicated table joins to the fle@field tables. Then you create a ne( field ;an Oracle Reports 6.0 construct used to format and display $olumns=, assi-n the ?ormula $olumn as its source, and add this field to your report usin- the screen painter. >ou need to include this field on the same Repeatin- ?rame ;an Oracle Reports 6.0 construct found in the screen painter that defines the freFuency of data retrie:ed= as the rest of your data, (here data could be actual report data, boilerplate, column headin-s, etc. The user e@it is called and fle@field information retrie:ed at the freFuency of the Repeatin- ?rame that contains your field. #n the report data case, the user e@it is called and fle@field information retrie:ed once for e:ery ro( retrie:ed (ith your Fuery. All fle@field se-ment :alues and descriptions are displayed left justified. Se-ment :alues are not truncated, that is, the /isplay SiHe defined in /efine Aey Se-ments screen is i-nored. Se-ment :alue descriptions are truncated to the description siHe ;if one is displayed= or the concatenated description siHe ;for concatenated se-ments= defined in the form. 0@> 3ow 'o you 'isplay Fle%file' Se!ment valesD Description an' Prompts on t&e report, $reate a ?ormula $olumn. $all the "ser E@it ?%/ ?&EN#/9A& as the formula in this column, This "ser e@its automatically fetches more complicated information such as description and prompts so that one does not has tot use complicated table joins to the fle@ field tables. 0A> -&at is a )reak #roup an' &ow 'o you create one, A brea2 -roup is used to create a report in (hich an identical :alues in seFuential ro(s is printed only once for its related records.;i.e. A brea2 -roup di:ides a Fuery]s columns into sets=. 0B> -&at is t&e 'ifference in usin! a E#roup FilterF Vs E a%imum RowF, 8a@imum Ro(s in the Guery Property sheet restricts the actual number of records fetched by the Fuery. A Croup ?ilter determines (hich records can be included or e@clude, after all the records ha:e been fetched by the Fuery. 1<> -&ic& built-in is use' to call t&e re(uire' Report, R"% PRO/"$T 10> .an you pass runtime parameters from reports to a #rap&ical 'isplay, >es you can pass 11> Do you use bin' reference to replace reserve' wor's or clauses, >es 18> -&ic& property &an'les a situation w&ere an e%pecte' parameter is not passe' runtime, #nitial 9alue 19> Do you use System Parameter DES/$ E to specify t&e 'estination type for output, %O, use /ESTT>PE

1:> Do you reference parts of SR- packa!e in layout format tri!!ers or report level tri!!ers, >es, you do. 1;> Do you t&ink t&at you can call contents of SR- Packa!e form wit&in any of Developer Tools, %o, you do not. 1@> -&ic& SR- packa!e is use' to apply specifie' formattin! attribute to t&e current layout ob7ect, SR'.SET ATTR 1A> *n a .&aracter #t is $ontinuous. 1B> *n a )it ap o'e environment action wit& t&e &ost computer is continuous or not, o'e environment action wit& t&e &ost computer is continuous or not,

#t is $ontinuous. 8<> Do you t&ink t&at reports store' in t&e 'atabase !enerally e%ecutes faster t&an t&ose store' in t&e file system, %o, Reports stored the file system -enerally e@ecutes faster than the report stored in the database. 80> *s it a'visable to remove t&e re'un'ant frames in t&e layout, >es, it is. 81> .an you 'etermine your own searc& pat&s for files calle' by Developer 1<<< tools in a win'ows environment, >es you can 88> -&ic& file is use' in a win'ows environment as t&e Performance File, $A"PRE?S.ORA 89> Does printer Definition file acts as a translator for t&e printer, >es 8:> EReports printer 'efinitions are store' as S6"2S filesF *s t&is statement true, %o, you don]t need. 8;> -&ic& table 'eletes ReportFs specific tables, SR'3./ROP SG& 8@> Does confine mo'e keeps c&il' ob7ects enclose' wit&in t&eir parent frames, >es it is. 8A> Do you t&ink t&at it is possible for you as a 'eveloper to assi!n common properties to multiple ob7ects, >es

8B> -&en you set packa!e break for an ob7ectD an ob7ect t&at appears below it always move to t&e ne%t pa!es4 *s it true, %o, #t is false. 9<> -&at are t&e cate!ories for report level ob7ects, /ata 8odel Objects, &ayout Objects and Parameter form. 90> *s an e%ternal (uery a collection of P"+S6" source co'e t&at can be reference' by ot&er mo'ules, %o, #t is not. 91> -&ic& 'esi!n tool 'efines t&e appearance of an interface t&at allow t&e en' user o supply runtime values to report, Parameter form Editor. 98> .an e%ternal (ueries be save' to t&e 'atabase, >es, >ou can. 99> -&at is containe' in t&e Database Ob7ects fiel's of t&e tables an' column names 'ialo! bo%, Table and 9ie( %ames. 9:> T&e aster Detail layout is t&e combination of w&ic& two layouts,

?orm and Tabular. 9;> )y 'efault is t&ere a pa!e break after eac& recor' in t&e form 'efault layout, >es there is. 9@> Does a break report always contain a break !roup, >es 9A> *s it true t&at a break report 'ata mo'el is create' usin! at least two (ueries an' at least one !roup, %o, it is false. 9B> *f you minimiGe t&e number of break columns in your break !roupsD will you minimiGe t&e number of columns t&at are a''e' to t&e or'er by clause, >es, you (ill. :<> T&e link clauseD w&ic& (uery to be e%ecute' for eac& instance of t&e parent !roup, $hild Guery. :0> 3ow many cursors 'o is reports &ave to open foe a two-(uery 'ata structure, T(o :1> Does 'efault columns referre' to as common columns, %o they are not.

:8> Default columns referre' to as Place 3ol'er columns, %o they are not. :9> Does a formula column perform user-'efine' computation on anot&er columns 'ata, >es ::> -&ic& fiel' in summary columns Property s&eet s&ows t&e calculation to be performe', ?unction ?ield. :;> *f a Place&ol'er columns 'ata type is "O/# or "O/#RO- can you e'it t&e wi't& file', >es you can. :@> -&at anc&ors, &in2s one or more layout objects to-ether. :A> Does (ueries are create' by 'efault, %o :B> -&ere you can restrict ma%imum number of rows, 8a@imum Ro(s property in the Guery Property Sheet. ;<> Oracle reports create one !roup for eac& (uery4 *s it true, >es ;0> .an you 'efine a Summary .olumn at a !roup "evel, >es (e can. ;1> Does links are create' by 'efault, %o ;8> )ecause of t&e creation of "inks t&e relations&ip between w&ic& two ob7ects is create', Croup and Guery. ;9> To pro'uce control break reportsD to pro'uce ma%imum reports an' to summariGe 'ata at interme'iate kevel w&ic& ob7ect is nee', Croup Object. ;:> *f you c&an!e a (uery name after t&e !roup &as been create'D can you c&an!e t&e name of t&e !roup, %o, >ou cannot. ;;> *f we take one (uery e%: select '4i'D e4salry from emp eD 'ept ' w&ere e4'ept5i' H '4i' or'er by salary $n' if we create break !roup wit& '4i'4 -&at will &appen, !ere order by clause is modified just li2e order by l, salary.

;@> $ link 'efines a Parent+.&il' relations&ip between a !roup an' a (uery4 *s it true, *f yes via w&ic& two keys, Primary and ?orei-n ;A> -&ic& term in S6" is relate' to IlinkJ in reports, Eoin ;B> .an you create a link from c&il' (uery to parent (uery, %o, al(ays creates a lin2 from parent Fuery to child Fuery. @<> -&at is )in' reference, A bind reference replaces a sin-le :alue or an e@pression. @0> -&at is "e%ical reference, A &e@ical reference replaces any part of a select statement such a s column name, from clause, (here clause order by clause. @1> *n w&ic& case parameter is create' by 'efault, #n case of bind reference parameter is created by default. @8> )in' reference is use' to replace w&ic& clause, '!ERE, CRO"P 1>, OR/ER 1>, !A9#%C, $O%%E$T 1>, and START '#T!. @9> "e%ical reference is use' to replace w&ic& clause, SE&E$T, ?RO8, '!ERE, CRO"P 1>, OR/ER 1>, !A9#%C, $O%%E$T 1>, and START '#T!. @:> -&at is a 2ser Parameter, #t is an object that you can hold :alues that user can chan-e at runtime. @;> -&at are t&e properties of Parameter, /atatype, (idth, #nput 8as2, #nitial 9alue and 9alidation Tri--er. @@> -&at is t&e function of ERestrict t&e list of pre-'etermine' values, #t is used to determine (hether to pre:ent users from enterin- any :alue not included in your list. @A> *f you unc&eck t&e restricte' values c&eckbo% w&at will &appen, "ser can also enter :alues to the &ist 1o@. @B> Does Oracle Reports allow D " operation in Format Tri!!er, %o A<> -&en you use #roup Filter in Data o'el,

-roup filter is a P&)SG& function that determines (hich records to include in a -roup, if the ?ilter Type property is P&)SG&. The function must return a boolean :alue ;TR"E or ?A&SE=. /ependin- on (hether the function returns TR"E or ?A&SE, the

current record is included or e@cluded from the report. >ou can access -roup filters from the Object %a:i-ator, the Property Palette ;the P&)SG& ?ilter property=, or the P&)SG& Editor. #roup Filter restrictions:

Croup filters cannot be added to -roups if ?ilter Type is ?irst or &ast. Croup filters cannot be added to cross.product -roups. #n a -roup filters, you can read the :alues of Report 1uilder columns and parameters of the correct freFuency ;loo2 at the rule belo(=, but you cannot directly set their :alues. ?or e@ample, you can use the :alue of a parameter called $O"%T0 in a condition ;e.-., #? ,$O"%T0 B 00=, but you cannot directly set its :alue in an assi-nment statement ;e.-., ,$O"%T0 B 00=. %ote also that the use of P&)SG& -lobal :ariables to indirectly set the :alues of columns or parameters is not supported. #f you do this, you may -et unpredictable results. >ou also cannot reference any pa-e. dependent columns ;i.e., Reset At of Pa-e= or columns that rely on pa-e.dependent columns in a -roup filter. The function that you enter for a -roup filter can only depend upon the follo(in- columns, a database column o(ned by the -roupIs Fuery or a Fuery abo:e it in the data model hierarchy $omputed columns ;formulas or summaries= that depend on unrelated Fueries ;i.e., computed columns that do not depend upon columns in the -roup, the -roupIs ancestors, or the -roupIs descendants=

A0> -&y you nee' to restrict recor's in a specific !roup, A1> -&enever a w&ere clause in ( (uery is not applicable w&ic& 'ata mo'el tri!!er is 2seful, A Croup ?ilter. A8> Do you a'' a filter to a %o, you cannot. A9> $ >es A:> 3ow many types of atri% Reports are t&ere, Tell me t&eir names, atri% Report is also referre' to as I.ROSS T$)J report4 *s it True, atri% .ross Pro'uct !roup,

There are 5 types. Simple 8atri@, %ested 8atri@, 8ulti Guery 8atri@ (ith 1rea2 ad 8atri@ 1rea2. A;> *f you buil' a atri% report wit& only one (ueryD &ow many !roups are re(uire in a''ition to one create' by 'efault,

4 Croups are reFuired. A@> 3ow many types of (uery structures are t&ere, Tell me t&e /ames, T(o. They are, One Fuery 8atri@ and 8ulti Fuery 8atri@. AA> atri% reports are buil' wit& for or more !roups4 *s it True, >es AB> -&at is t&e 'ifference between /este' atri% an' a atri% )reak,

#n case of 8atri@ 1rea2, one or more -roups are a parent of the cross product -roup. And in case of %ested matri@, three or more -roups are surrounded by he cross product -roup. B<> -&at are t&e components of a Report )uil'er, Object %a:i-ator, &ayout 8odel, /ata 8odel, Property Pallet and P&)SG& Editor.

B0> -&at are t&e E%tension of t&e report, rdf \ 1inary Source ?ile. .rep \ 1inary E@ecutable ?ormat. .re@ \ Te@t ?ormat. .tdf \ report template binary file. >ou can chan-e .rdf and .re@ to .rep usin- R'$O%60 or -o to ?ile .S Admin .S $on:ert. B1> .an you run t&e report wit&out a parameter forms, >es, #t is possible to run a report (ithout the parameter form by settin- the PARA8 :alue to %"&&. E@, add paramerter;pl id, ^PARA8?OR8],TENT PARA8ETER,%"&&=L B8> -&at ate Data o'el an' "ayout o'el,

The /ata retrie:ed for a report is defined in /ata 8odel and style of the report is defined in &ayout 8odel. B9> -&at are t&e )ack !roun' processes in Oracle an' w&at are t&ey, This is one of the most freFuently as2ed Fuestions. There are basically * Processes but in a -eneral system (e need to mention the first fi:e bac2-round processes. They do the house 2eepin- acti:ities for the Oracle and are common in any system. The :arious bac2-round processes in oracle are,

/ata 1ase 'riter ;/1'R= .. /ata 1ase 'riter 'rites 8odified bloc2s from /atabase buffer cache to /ata ?iles. This is reFuired since the data is not (ritten (hene:er a transaction is committed. &o-'riter ;&C'R= .. &o-'riter (rites the redo lo- entries to dis2. Redo &o- data is -enerated in redo lo- buffer of SCA. As transaction commits and lo- buffer fills, &C'R (rites lo- entries into a online redo lo- file. System 8onitor ;S8O%= .. The System 8onitor performs instance reco:ery at instance startup. This is useful for reco:ery from system failure Process 8onitor ;P8O%= .. The Process 8onitor performs process reco:ery (hen user Process fails. Pmon $lears and ?rees resources that process (as usin-. $hec2Point ;$APT= .. At Specified times, all modified database buffers in SCA are (ritten to data files by /1'R at $hec2points and "pdatin- all data files and control files of database to indicate the most recent chec2point Achie:es ;AR$!= .. The Archi:er copies online redo lo- files to archi:al storal (hen they are busy. Reco:eror ;RE$O= .. The Reco:eror is used to resol:e the distributed transaction in net(or2 /ispatcher ;/nnn= .. The /ispatcher is useful in 8ulti Threaded Architecture &c2n .. 'e can ha:e up to 00 loc2 processes for inter instance loc2in- in parallel sFl.

B:> 3ow many types of S(l Statements are t&ere in Oracle, There are basically 6 types of sFl statments.They are

/ata /efinition &an-ua-e ;//&= .. The //& statements define and maintain objects and drop objects. /ata 8anipulation &an-ua-e ;/8&= .. The /8& statements manipulate database data. Transaction $ontrol Statements .. 8ana-e chan-e by /8& Session $ontrol .. "sed to control the properties of current session enablin- and disablin- roles and chan-in- e.-. Alter Statements, Set Role. System $ontrol Statements .. $han-e Properties of Oracle #nstance .e.-. Alter System. Embedded SFl .. #ncorporate //&, /8& and T.$.S in Pro-rammin- &an-ua-e. e.-. "sin- the SFl Statements in lan-ua-es such as I$I, Open, ?etch, e@ecute and close

B;> -&at is a Transaction in Oracle, A transaction is a &o-ical unit of (or2 that compromises one or more SG& Statements e@ecuted by a sin-le "ser. Accordinto A%S#, a transaction be-ins (ith first e@ecutable statement and ends (hen it is e@plicitly committed or rolled bac2.

Key -or's 2se' in Oracle The Aey (ords that are used in Oracle are, .ommit: A transaction is said to be committed (hen the transaction ma2es permanent chan-es resultin- from the SG& statements. Rollback: A transaction that retracts any of the chan-es resultin- from SG& statements in Transaction. SavePoint: ?or lon- transactions that contain many SG& statements, intermediate mar2ers or sa:epoints are declared. Sa:epoints can be used to di:ide a transaction into smaller points. Rollin! Forwar': Process of applyin- redo lo- durin- reco:ery is called rollin- for(ard. .ursor: A cursor is a handle ;name or a pointer= for the memory associated (ith a specific statement. A cursor is basically an area allocated by Oracle for e@ecutin- the sFl Statement. Oracle uses an implicit cursor statement for Sin-le ro( Fuery and "ses E@plicit cursor for a multi ro( Fuery. System #lobal $rea =S#$>: The SCA is a shared memory re-ion allocated by the Oracle that contains /ata and control information for one Oracle #nstance. #t consists of /atabase 1uffer $ache and Redo lo- 1uffer. Pro!ram #lobal $rea =P#$>: The PCA is a memory buffer that contains data and control information for ser:er process. Database )uffer .ac&e: /atabase 1uffer of SCA stores the most recently used bloc2s of database data. The set of database buffers in an instance is called /atabase 1uffer $ache. Re'o lo! )uffer: Redo lo- 1uffer of SCA stores all the redo lo- entries. Re'o "o! Files: Redo lo- files are set of files that protect altered database data in memory that has not been (ritten to /ata ?iles. They are basically used for bac2up (hen a database crashes. Process: A Process is a Ithread of controlI or mechanism in Operatin- System that e@ecutes series of steps. B@> -&at are Proce'ureD functions an' Packa!es, Proce'ures an' functions consist of set of P&)SG& statements that are -rouped to-ether as a unit to sol:e a specific problem or perform set of related tas2s. Procedures do not return :alues (hile ?unctions return one 9alue. Packa!es: Pac2a-es pro:ide a method of encapsulatin- and storin- related procedures, functions, :ariables and other Pac2a-e $ontents BA> -&at are Database Tri!!ers an' Store' Proce'ures, Database Tri!!ers /atabase Tri--ers are Procedures that are automatically e@ecuted as a result of insert in, update to, or delete from table. /atabase tri--ers ha:e the :alues old and ne( to denote the old :alue in the table before it is deleted and the ne( indicated the ne( :alue that (ill be used. /T are useful for implementin- comple@ business rules (hich cannot be enforced usin- the inte-rity rules. 'e can ha:e the tri--er as before tri--er or After Tri--er and at Statement or Ro( le:el. e.-., operations insert, update and delete .. 4. 1efore after 4K3 A total of 6 combinations. At statement le:el ;once for the tri--er= or ro( le:el ; for e:ery e@ecution = . 6 K 3 A total of 03. . Thus a total of 03 combinations are there and the restriction of usa-e of 03 tri--ers has been lifted from Oracle 6.4 On(ards. . Store' Proce'ures:

Stored Procedures are Procedures that are stored in $ompiled form in the database. The ad:anta-e of usin- the stored procedures is that many users can use the same procedure in compiled and ready to use format. BB> 3ow many *nte!rity Rules are t&ere an' w&at are t&ey, There are Three #nte-rity Rules. They are as follo(s,

Entity #nte-rity Rule .. The Entity #nte-rity Rule enforces that the Primary 2ey cannot be %ull. ?orei-n Aey #nte-rity Rule .. The ?A#R denotes that the relationship bet(een the forei-n 2ey and the primary 2ey has to be enforced. 'hen there is data in $hild Tables the 8aster tables cannot be deleted. 1usiness #nte-rity Rules .. The Third #nte-rity rule is about the comple@ business processes (hich cannot be implemented by the abo:e 3 rules. aster an' Detail Relation s&ips,

0<<> -&at are t&e Various

The :arious 8aster and /etail Relationship are

%on#solated .. The 8aster cannot be deleted (hen a child is e@istin#solated .. The 8aster can be deleted (hen the child is e@istin$ascadin- .. The child -ets deleted (hen the 8aster is deleted.

0<0> -&at are t&e Various )lock .oor'ination Properties, The :arious 1loc2 $oordination Properties

#mmediate /efault Settin- ..The /etail records are sho(n (hen the 8aster Record are sho(n. /effered (ith Auto Guery ..Oracle ?orms defer fetchin- the detail records until the operator na:i-ates to the detail bloc2. /effered (ith %o Auto Guery .. The operator must na:i-ate to the detail bloc2 and e@plicitly e@ecute a Fuery

0<1> -&at are t&e Different OptimiGation Tec&ni(ues, The 9arious OptimiHation techniFues are E%ecute Plan: 'e can see the plan of the Fuery and chan-e it accordin-ly based on the inde@es OptimiGer5&int: set item property;I/ept1loc2I,OPT#8#_ER !#%T,I?#RST RO'SI=L Select )KT ?irst Ro(s K) /eptno,/name,&oc,Ro(id from dept (here ;/eptno S 3+= OptimiGe5S(l: 1y settin- the OptimiHe SFl B %o, Oracle ?orms assi-ns a sin-le cursor for all SG& statements. This slo( do(ns the processin- because for e:ertime the SG& must be parsed (hene:er they are e@ecuted.f5+run module B my firstform userid B scott)ti-er optimiHe sFl B %o OptimiGe5Tp: 1y settin- the OptimiHe TpB %o, Oracle ?orms assi-ns seperate cursor only for each Fuery SE&E$T statement. All other SG& statements reuse the cursor. f5+run module B my firstform userid B scott)ti-er optimiHe Tp B %o

0<8> 3ow 'o u implement t&e *f statement in t&e Select Statement 'e can implement the if statement in the select statement by usin- the /ecode statement. E.-. select /E$O/E ;E8P $AT,I0I,I?irstI,I3I,ISecondI%ull=L !ere the %ull is the else statement (here null is done. 0<9> 3ow many types of E%ceptions are t&ere, There are 3 types of e@ceptions. They are System E%ceptions E.-. 'hen no data found, 'hen too many ro(s 2ser Define' E%ceptions e.-. 8y e@ception e@ception 'hen 8y e@ception then 0<:> -&at are t&e inline an' t&e precompiler 'irectives, The inline and precompiler directi:es detect the :alues directly 0<;> 3ow 'o you use t&e same lov for 1 columns, 'e can use the same lo: for 3 columns by passin- the return :alues in -lobal :alues and usin- the -lobal :alues in the code 0<@> 3ow many minimum !roups are re(uire' for a matri% report, The minimum number of -roups in matri@ report is 5 0<A> -&at is t&e 'ifference between static an' 'ynamic lov The static lo: contains the predetermined :alues (hile the dynamic lo: contains :alues that come at run time 0<B> -&at are snap s&ots an' views, Snapshots are mirror or replicas of tables. 9ie(s are built usin- the columns from one or more tables. The Sin-le Table 9ie( can be updated but the :ie( (ith multi table cannot be updated 00<> -&at are t&e OOPS concepts in Oracle4 Oracle does implement the OOPS concepts. The best e@ample is the Property $lasses. 'e can cate-ories the properties by settin- the :isual attributes and then attach the property classes for the objects. OOPS supports the concepts of objects and classes and (e can consider the property classes as classes and the items as objects 000> -&at is t&e 'ifference between can'i'ate keyD uni(ue key an' primary key $andidate 2eys are the columns in the table that could be the primary 2eys and the primary 2ey is the 2ey that has been selected to identify the ro(s. "niFue 2ey is also useful for identifyin- the distinct ro(s in the table. 001> -&at is concurrency, $oncurrency is allo(in- simultaneous access of same data by different users. &oc2s useful for accessin- the database are E%clusive The e@clusi:e loc2 is useful for loc2in- the ro( (hen an insert, update or delete is bein- done. This loc2 should not be applied (hen (e do only select from the ro(.

S&are lock 'e can do the table as Share &oc2 as many share loc2s can be put on the same resource. Privile!es an' #rants Previle!es are the ri-ht to e@ecute a particular type of SG& statements. e.-., Ri-ht to $onnect, Ri-ht to create, Ri-ht to resource. #rants are -i:en to the objects so that the object mi-ht be accessed accordin-ly. The -rant has to be -i:en by the o(ner of the object. 008> -&at is Table SpaceD Data FilesD Parameter FileD .ontrol Files, Table Space: The table space is useful for storin- the data in the database. 'hen a database is created t(o table spaces are created. System Table Space: This data file stores all the tables related to the system and dba tables 2ser Table Space: This data file stores all the user related tables 'e should ha:e separate table spaces for storin- the tables and inde@es so that the access is fast. Data Files: E:ery Oracle /ata 1ase has one or more physical data files. They store the data for the database. E:ery data file is associated (ith only one database. Once the /ata file is created the siHe cannot chan-e. To increase the siHe of the database to store more data (e ha:e to add data file.

Parameter Files: Parameter file is needed to start an instance. A parameter file contains the list of instance confi-uration parameters e.-. db bloc2 buffers B +00 db name B ORA6 db domain B u.s.acme lan.ontrol Files: $ontrol files record the physical structure of the data files and redo lo- files They contain the /b name, name and location of dbs, data files ,redo lo- files and time stamp. P&ysical Stora!e of t&e Data The finest le:el of -ranularity of the data base is the data bloc2s. Data )lock One /ata 1loc2 correspond to specific number of physical database space E%tent: E@tent is the number of specific number of conta-ious data bloc2s.

Se!ments: Set of E@tents allocated for E@tents. There are three types of Se-ments /ata Se-ment, %on $lustered Table has data se-ment data of e:ery table is stored in cluster data se-ment #nde@ Se-ment, Each #nde@ has inde@ se-ment that stores data Roll 1ac2 Se-ment, Temporarily store IundoI information 009> -&at are t&e Pct Free an' Pct 2se', Pct ?ree is used to denote the percenta-e of the free space that is to be left (hen creatin- a table. Similarly Pct "sed is used to denote the percenta-e of the used space that is to be used (hen creatin- a table E-. Pctfree 30, Pctused 50 00:> -&at is Row .&ainin!, The data of a ro( in a table may not be able to fit the same data bloc2. /ata for ro( is stored in a chain of data bloc2s. 00;> -&at is a 1 P&ase .ommit, T(o Phase commit is used in distributed data base systems. This is useful to maintain the inte-rity of the database so that all the users see the same :alues. #t contains /8& statements or Remote Procedural calls that reference a remote object. There are basically 3 phases in a 3 phase commit. Prepare P&ase: Clobal coordinator as2s participants to prepare .ommit P&ase: $ommit all participants to coordinator to Prepared, Read only or abort Reply 00@> -&at is t&e 'ifference between 'eletin! an' truncatin! of tables, /eletin- a table (ill not remo:e the ro(s from the table but entry is there in the database dictionary and it can be retrie:ed 1ut truncatin- a table deletes it completely and it cannot be retrie:ed. 00A> -&at are mutatin! tables, 'hen a table is in state of transition it is said to be mutatin-. e- ,, #f a ro( has been deleted then the table is said to be mutatin- and no operations can be done on the table e@cept select. 00B> -&at are .o'' Rules, $odd Rules describe the ideal nature of a R/18S. %o R/18S satisfies all the 03 codd rules and Oracle Satisfies 00 of the 03 rules and is the only Rdbms to satisfy the ma@imum number of rules. 01<> -&at is /ormaliGation, %ormaliHation is the process of or-aniHin- the tables to remo:e the redundancy. There are mainly + %ormaliHation rules. 0. 3. 4. 0 /ormal Form: A table is said to be in 0st %ormal ?orm (hen the attributes are atomic 1 /ormal Form: A table is said to be in 3nd %ormal ?orm (hen all the candidate 2eys are dependant on the primary 2ey 8r' /ormal Form: A table is said to be third %ormal form (hen it is not dependant transiti:ely

010> -&at is t&e Difference between a post (uery an' a pre (uery A post Fuery (ill fire for e:ery ro( that is fetched but the pre Fuery (ill fire only once. 011> Deletin! t&e Duplicate rows in t&e table 'e can delete the duplicate ro(s in the table by usin- the Ro(id.

018> .an 2 'isable 'atabase tri!!er, 3ow, >es. 'ith respect to table A&TER TA1&E TA1&E X /#SA1&E all tri--er Y

019> -&at is a pseu'o column, /ame t&em, A pseudocolumn beha:es li2e a table column, but is not actually stored in the table. >ou can select from pseudocolumns, but you cannot insert, update, or delete their :alues. This section /escribes these pseudocolumns, $"RR9A&, %ENT9A& , &E9E& , RO'#/ , RO'%"8 01:>3ow many columns can table &ave, The number of columns in a table can ran-e from 0 to 3+5. 01;> *s space ac(uire' in blocks or e%tents, #n e@tents. 01@> -&at is clustere' in'e%, #n an inde@ed cluster, ro(s are stored to-ether based on their cluster 2ey :alues . $an not apply for !AS!. 01A> -&at are t&e 'ata types supporte' )y oracle =*/TER/$">, 9archar3, %umber, $har, 8&S&A1E&. 01B> -&at are attributes of cursor, J?O"%/ , J%OT?O"%/ , J#SOPE%,JRO'$O"%T 08<> .an you use select in FRO >es clause of S6" select,

Das könnte Ihnen auch gefallen