A) Tabular Report B) Group Left Report C) Group Above Report
D) Form like report E) Matrix Report F) Multi Media Report
G) Mailing Label Report H) OLE Report.
2. ANCHOR
Anchors are used to determine the vertical and horizontal positioning of a child object relative to its parent object. The end of the anchor should be attached to the parent object.
A) Parent Object B) Child Object
Since the size of the same layout objects may change when the report runs (When the data is actually fetched), anchors need to be defined to make the appearance of the object.
An Anchor defines the relative position of an object to the object to which if this anchored.
* Symbol is
By pressing the shift key Anchor can be moved.
Anchor Properties:
A) Child Edge percent on child edge type B) Child Object Name C) Collapse Horizontally
D) Collapse vertically E) Comments F) Name
* Two child objects can be related to one parent object by an Anchor.
User Exits :
A user exit is a program that can be written and linked into the report builder executable or user exit DLL files.
User exits are built when ever the control needs to be passed from the report builder to a program, which performs some function and then control returns to the Report Builder.
Types of user exits:-
A) Oracle Pre-Complier user exits.
B) OCI (Oracle Call Interface user exits)
C) Non – Oracle user exits.
User exits can perform the following tasks.
Perform complex data manipulation.
Pass data to report builder from OS text files.
Support PL/SQL blocks.
Control real time devices like printer or robot.
3. Types of Triggers in Reports :-
* Report Triggers * Data Triggers * Layout Triggers
REPORT TRIGGERS:
Before Parameter form Trigger
After Parameter form Trigger.
Before Report Trigger.
Between Pages Trigger
After Report Trigger
+ Firing Sequence
* Before Parameter form Trigger
- A fire before the runtime parameter form is displayed.
- The parameter values can be accessed and changed.
* After Parameter form Trigger.
- Fires after the runtime parameter form are displayed.
- The parameters can be accessed and their values can be checked.
* Before Report Trigger
- Fires before the reports is executed but after the queries are passed and data is fetched.
* Between Pages Trigger
- Fires between each page of the report is formatted, except the very first page.
- This is used for customized page formatting.
* After Report Trigger
- Fires after exiting from the run time premier or after report output is sent to a specified destination. (File, Printer, Mail id etc….)
- This is used to clean up any initial processing that was done such as deleting the tables.
- This Trigger always fires irrespective of success or failure of the report.
DATA TRIGGERS:
* Ref Cursor Query.
- This uses PL/SQL to fetch data for the report.
- In this a PL/SQL function need to be specified to return a cursor value from a cursor variable.
* Group Filter:
This is PL/SQL function that determines which records to be included in a group in the property is PL/SQL.
- The function must return a BOOLEAN value.
True …….. Includes the current record in the report.
False ……. Excludes the current record from the report.
* Formula
- These are PL/SQL functions that populate formula or place holder columns.
* Validation Trigger
- These are also PL/SQL functions that are executed when parameter values are specified on the command line and when the runtime parameter form is accepted.
- Are also used to validate the initial value property of the parameter.
LAYOUT TRIGGERS:
* Format Trigger.
- These are PL/SQL functions executed before the object is formatted.
- Used to dynamically change the formatting attributes of the object.
* Action Trigger
- These are PL/SQL procedures executed when a button is selected in the run time previewer.
- This can be used to dynamically call another report or execute any other PL/SQL.
Formula Column
It performs a user-defined computation on another columns data, including Place-holder columns. Formulas are PL/SQL functions that populate formula or place holder columns. Cannot be used to populate parameter values.
Summary Column
- Performs a computation on another columns data like sum, average, count, minimum, maximum, %, total.
- For group reports, the report wizard and data wizard create ‘n’ summary fields in the data model for each summary column that is defined.
---à One at each group level above the column being summarized.
---à One at the report level.
Place Holder Column
- A Place holder column is a column for which, the data type and value can be set dynamically (Programmatically)
* The value can be set for a place holder column in the following places.
- Before report trigger if the place holder is a report level column.
- Report level formula column, if the place holder is a report level column.
- A formula in the place holders group below it (The value is set once for each record of the group)
Repeating Frame
- Repeating frame surrounds all of the fields that are created for a group column.
- Repeating frame prints once for each record of the group.
- For frames and repeating frames, the property elasticity defines whether the size of the frame or repeating frame should with the objects inside of it at runtime.
Frame
- Surrounds the objects and protect them from being over written or pushed by other objects.
System Parameters in Reports
* Background * Copies * Currency * Decimal
* Desformat * Desname * Destype * Mode
* Orientation * Print Job * Thousands.
Data Link
- Data links relate the results of multiple queries.
- A data link (Parent – Child Relationship) causes the child query to be executed once for each instance of its parent group.
In which tables FF are stored?
A) FND-ID-FLEXS
B) FND-ID-FLEX-STRUCTURES
Difference between a function and a procedure
Functions Procedures
* Invoke as a part of an expression. Execute as a PL/SQL statement.
* Must contain a RETURN clause in the header. Do not contain a RETURN clause in the header.
* Must return a single value. Can return none, one or many c values.
* Must contain at fast one RETURN Stament Can contain a RETURN Statement.
* Do not contain OUT and INOUT Parameters. Can contain IN, Out and IN OUT Parameters
About Cursors
- Oracle server uses some private work areas to execute SQL statements and to store processing information.
* By using PL/SQL cursors these private SQL areas can be named and the stored information can be accessed.
* Implicit Cursors
- Implicit cursors are declared by PL/SQL implicitly for all DML and PL/SQL select statements, including queries that return only one row.
- Oracle Server implicitly opens a cursor to process each SQL statement not associated with on explicitly declared cursor.
- The most recent implicit cursor can be returned as the SQL cursor.
* Explicit Cursors
- For queries that return more than one row, explicit cursors are declared and named by the programmes and manipulated through specific statements in the block’s executable actions.
- Explicit cursors are used to individually process each row returned by a multiple-row SELECT statement.
- The set of rows returned by a multiple – row query is called as active set.
Cursor Attributes:-
Attribute Type Description
% is open Boolean Evaluates to TRUE if the cursor is open.
% not found Boolean Evaluates to TRUE if the most recent fetch doesn’t return a row.
% found Boolean Evaluate to TRUE if the most recent fetch
returns a row. Complement of % not found.
% Row Count Number Evaluates the total number of rows returned so far.
Parameterized Cursors:-
- Parameters can be passed to the cursor in a cursor for loop.
- It allow to open and close an explicit cursor several times in a block, returning a different active set on each occasion for each execution, the previous cursor is closed and reopened with a new set of parameters.
- Sizes should not be mentioned for the data types of parameters the parameters names are for references in the query expression of the cursor.
Confined Mode:-
- If it is on, child objects cannot be moved outside their enclosing parent objects.
- If it is off child objects can be moved out sides their enclosing parent objects.
Flex Mode:-
- If it is on, parent borders stretch when child objects are moved against them.
- If it is off, parent borders remain fixed when child objects are moved against them.
Parameters
- A parameter is a variable whose value can be set at runtime (from the run time parameter of the command line).
- User parameters are created by the user and system parameters are created by Report Builder.
- System parameters cannot be renamed or deleted.
Bind Parameters (Variables)
- Bind references (or Variables) are used to replace a single value in SQL or PL/SQL, such as a character string, number or date.
- Bind references may be used to replace expressions in SELECT, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY and START WITH clauses of queries.
- Bind references cannot be referenced in FROM clauses.
- Bind variables can be referenced by entering a colon (:) followed immediately by the column or parameter name.
Lexical Parameters (Variables)
- Lexical references are place holders for text that is embedded in a SELECT statement.
- Lexical Variables can replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH.
What is % Row type
- % Row types is used to declare a record based on a collection of columns in a database table or view.
- The fields in the record take their names and data types from the columns of the table or view.
- The record can also store an entire row of data fetched from a cursor or cursor variable.
- % Row type should be prefixed with the database table.
What is a Ref Cursor?
- Oracle server uses unnamed memory spaces to store data used in implicit cursors.
- Ref cursors are used to define a cursor variable, which will point to that memory space and can be used like pointers in SQL ‘S’.
About Exceptions
- An exception is an identifier in PL/SQL that is raised during the execution of a block that terminates its main body of actions.
- A block always terminates when PL/SQL raises an exception so that an exception handler should be specified to perform final actions.
* Exception can be raised in two ways exception is raised automatically.
- Ex:- when no rows are retrieved from the database in a SELECT statement, then error
ORA-01403 occurs and the exception NO-DATA-FOUND is raised by PL/SQL.
- Ex:- Exception can be raised explicitly by issuing the RAISE statement with in the block.
- The exception being raised may be either.
User-Defined or Pre Defined
Trapping an exception:-
- If the exception is raised in executable section of the block, processing branches to the corresponding exception handler in the exception section of the block.
- If PL/SQL successfully handles the exception, then the exception doesn’t propagate to the enclosing block or calling environment.
- The PL/SQL block terminates successfully.
Propagating an exception:-
- If the exception is raised in the executable section of the block and there is no corresponding exception handler, the PL/SQL block terminates with failure and the exception will be propagated to the calling environment.
Types of exceptions:-
A) Pre-Defined Oracle Server Exceptions. -à Implicitly Raised.
B) Non-Pre defined Oracle server exceptions. -à Implicitly Raised.
C) User-defined exceptions -à Explicitly Raised.
Pre-Defined Oracle Server Exceptions:-
- These are the errors (20) that occur most often in PL/SQL code.
- These exceptions need not be declared and raised implicitly by Oracle Server, NO-DATA-FOUND, LOGIN_DENIED and ZERO_DIVIDE.
Non-Pre-Defined Oracle Server Exceptions:-
- These are the other standard Oracle Server errors.
- These exceptions need to be declared in the declarative section and raised by Oracle server implicitly.
User Defined Exceptions:-
- These are the conditions that the developer determines as abnormal.
- These need to be declared and raised explicitly.
PRAGMA EXCEPTION_INIT
Statement is used to associate a declared exception with the standard Oracle Server error number.
Syntax: - PRAGMA EXCEPTION_INIT (exception, error number)
* SQLCODE, SQL ERRM are two functions which can be used to identify the associated error code or error message when exception occurs.
- SQLCODE function returns the numeric value for the error code.
- SQLERRM funt returns the character data containing the message associated with the error number.
- SQLCODE , SQLERRM cannot be used directly in SQL statements.
What is Dynamic SQL?
- Dynamic SQL is a SQL statement that contains variables that can change during runtime.
- It is a SQL statement with place holders and is stored as a character string.
- Dynamic SQL enables DDL, DCL or session control statements to be written and executed (by) from PL/SQL.
* Dynamic SQL can be written in two ways.
A) DBMS_SQL. -à 8i
B) Native Dynamic SQL. -à 8i
- Basically Dynamic SQL means creating the SQL statements dynamically at runtime by using variables.
Ex: - Dynamic SQL can be used to create a procedure that operates on a table whose name is not known until runtime or to execute DDL/DCL/SCS statements.
--à In PL/SQL such statements cannot be executed statically.
--à EXECUTE IMMEDIATE Statement can perform dynamic single row queries.
What are Autonomous Transactions?
- Autonomous transactions are the processes run independently of its parent.
- By means of Autonomous Transaction, the current transaction can be temporarily suspended and another operation can be begun.
- The basic idea behind this is to have some operation take place independently of the current transaction.
Ex:- to allow error messages written to table to be committed but to rollback everything
else that has taken place prior to the error.
- The autonomous or child transaction can commit or rollback as applicable with the execution of the parent transaction being resumed upon its completion.
- The parent may then perform further operations of any operations performed with in the child transaction.
- By using Autonomous Transactions, modular and reusable components can be developed more easily.
- In fact Oracle already uses similar functionality internally, known as recu transactions to handle the updating of system resources.
PRAGMA AUTONOMOUS_TRANSACTION;
- Autonomous transaction also can be nested.
- The parent transaction remains active while any statements specified in the declare section of the autonomous unit are executed.
- As the code unit exits and control returns to the parent & the main (parent) transaction is resumed and the transaction context is switched back to the parent.
What is Bulk binding and Bulk collect?
Bulkbind:-
- The assignment of values to PL/SQL variables in SQL statements is called binding.
- The binding of an entire collection at once is refereed to as bulk binding.
- Bulk bind improves performance by minimizing the number of context switches between PL/SQL and SQL engines while they pass an entire collection of elements (varray, nested tables, index-by table or host array) as bind variables back and forth.
- Prior to Oracle 8i, the execution of every SQL statements required a switch between the PL/SQL and SQL engines, where as bulk binds use only one context switch.
* Bulk binding includes the following
A) Input collections; use the FORALL statement.
B) Output collections, use the BULK COLLECT clause.
Input Collections:-
- Input collections are data passed from PL/SQL engine to the SQL engine to execute INSERT, UPDATE and DELETE statements.
Syntax:- FORALL index in lower_bound.. upper_bound sql_statement;
Output Collections:-
- Output collections are the data passed from the SQL engine to the PL/SQL engine as a result of SELECT or FETCH statements.
- The keyword BULK COLLECT can be used with SLECT INTO, FETCH INTO and RETURNING INTO clauses.
Syntax: - BULK COLLECT into collection_name, ……
What are Materialized Views and Snapshots?
Materialized View:-
- A Materialized view is a replica of a target master from a single point in time.
- In Oracle 7, it is termed as SNAPSHOT
- Oracle 7.1.6 --à Uptable Snapshots
- Oracle 7.3 -à Primary Key Snapshots
- Oracle 8 -à Materialized view
- Oracle 9 -à Multifier Materialized View.
- Materialized views can be used both for creating summaries to be utilized in data warehouse environments.
* Replicating data in distributed environments.
Target Master -à The table(s) which is (are) referenced by the MVIEW query.
Base Table -à The tables are that is (are) created by MVIEW create statement and that stores data that satisfy the MVIEW query.
Syntax:- Create materialized view <name>
Refresh fast
Start with sysdate
Next sysdate +1 as
Select *from <master table>;
- Since this is a fast refreshed MVIEW the master table should have a log (Master log) to record the changes on it that can be created by running.
Create materialized view log on master_table;
-à this statement creates the following objects
- a table called MLOG$_Master_table
- an internal trigger on Master_table that populates the log table.
* Master Log tables (MLOG$) are used by fast refresh procedure.
Refreshing Materialized Views:-
- Initially a materialized view contains the same data as in the master table.
- After the MVIEW is created, changes can be made to the master table and possibly also to the MVIEW.
- To keep a MVIEW data relatively current with the data in the master table, the MVIEW must be periodically refreshed.
* Refresh can be accomplished by one of the following procedures.
Dbms_mview.refresh (<mview list>, <Refresh types>)
Dbms _ refresh.refresh (<Refresh Groups>)
Refresh Types -à Complete Refresh, Fast Refresh, Force Refresh
* Complete Refresh is performed by deleting the rows from the snapshot and inserting the
rows satisfying the MVIEW query.
* In Fast refresh only the rows updated since last refresh are pulled from the master table to
insert into MVIEW.
* This requires a log table called as MVIEW Log to be created on the Master Table.
* Force refresh first tries to run a Fast refresh if possible. If fast refresh is not possible, it performs complete refresh.
26. How duplicate rows are deleted?
- Duplicate rows are deleted by using ROWID
Syntax à delete from <Table>
Where ROWID not in (Select max (ROWID) from <Table>
Group by <Column_name>);
27. How do you call function and procedure in PL/SQL as well as in SQL prompt?
isql*plus à EXECUTE < Function/Procedure name > ;
(SQL prompt)
PL/SQL à < Procedure Name / Function Name>;
(from another procedure)
Development Tools à <Procedure name>;
28. Difference between IN and OUT parameters.
Three types of parameters
1. IN 2. OUT 3.IN OUT
IN parameter:
- This parameter passes a value from the calling environment into the procedure.
- This is the default mode
- A formal parameter of In mode cannot be assigned a value ( we IN parameter cannot be modified in the body of the procedure)
- IN parameters can be assigned a default value in the parameter list.
- IN parameters are passed by reference.
OUT parameters:
- OUT parameter must be assigned a value before returning to the calling environment.
- OUT parameter passes a value from the procedure to the calling environment
- OUT parameter can not be assigned a default value in the parameter list.
IN OUT parameter:
- this type of parameter pass a value from the calling environment into the procedure and a possibly different value from the procedure back to calling environment using the same parameter.
- IN OUT parameter cannot be assigned a default value. * By default OUT & IN OUT parameters are passed by value.
- These can be passed by reference by using NOCOPY.
29. Triggers:
- A trigger is a PL/SQL block or a PL/SQL procedure associated with a table view schema or the database.
- The code in the trigger executes implicitly whenever a particular event occurs.
Two types of triggers:
Application trigger
- fires whenever an event occurs with in a particular application
Database Trigger
- Fires whenever a data event (Such as DML) or system event (such as log on or shut down) occurs on a schema or database.
- Executes implicitly when a data event. Such as DML on a table (insert, delete or Update), an INSTEAD OF trigger on a VIEW or DDL statements are issued no matter which user is connected or which application is used.
- Also executes implicitly when some user or data base system actions occur.
- Ex. When user logs on to the system.
When DBA shuts down the data base.
- Date base triggers can be defined on tables and on views.
- If a DML operations as issued on a view, the INSTEAD OF trigger defines what action takes place, if these actions include any DML operations on tables, then any triggers on the base tables are fired.
- Data base triggers can be system triggers on a data base or a schema.
- With a data base, triggers fire for each event for all users, with a schema, triggers fire for each event for the specific user.
Recursive trigger :
- This is a trigger that contains a DML operation changing the very same table.
Cascading Trigger:
- The action of one trigger cascades to another trigger, causing this second trigger to fire.
- Oracle server allows up to 32 triggers to cascade at any one time.
- This number can be changed by changing the value of the OPEN - CURSORS. Data bases initialization parameter. ( default value is 50 ).
- * A triggering statement should contain
1 Trigger Timing Before, After (For Table)
Instead of (For View)
- Determines when the trigger needs to be fired in relation to the triggering event.
2 Triggering Event Insert, Update, Delete
- Determines which on the table or view causes the trigger to fire.
3 Trigger Type Statement, Row
- Determines how many times the trigger body executes
4 Table name Table, View
5 Trigger body à PL/SQL – block
- Determines what actions the trigger should perform.
* INSTEAD of triggers are used to provide a transparent way to modifying views that cannot be modified directly through SQL, DML statements because the view is not modifiable.
-à INSTEAD of triggers provide writing of Insert, Update and Delete statements against the
view.
- The INSTEAD if trigger works invisibly in the background performing the action coded in the trigger body directly on the underlying tables.
- INSTEAD of trigger execute the trigger body instead of the triggering statement.
Statement Triggers
- In this type of triggers, the trigger body executes once for the triggering event.
- This is the default.
- Statement trigger fires once, even if no rows are affected at all.
Row Trigger
- In this type, the trigger body executes once for each row affected by the triggering event.
- Row trigger is not executed if the triggering event affects no rows.
* A view cannot be modified by normal DML if the view query contains set operators,
group functions, group by, connect By, start with clauses or joins.
Mutating Table
- A Mutating table is a table that is currently being modified by an UPDATE, DELETE OR INSERT statement, or a table that might need to be updated by the effects of a declarative DELETE CASCADE referential integrity action.
- A table is not considered mutating for statement triggers.
- A mutating table cannot be changed because the resulting DML could change data that is in inconsistent state.
What is SQL Trace?
- SQL Trace is the main method for collecting SQL execution information in Oracle collecting a wide range of information and statistics that can be used to tune SQL operations.
- The SQL – Trace facility can be enabled / disabled for an individual session or at the instance level.
- If the initialization parameter SQL-TRACE is set to TRUE in the init.ora of an instance, then all sessions will be traced.
- SQL-TRACE can be set at the instance level by using the initialization parameter SQL-TRACE.
- SQL-TRACE can also be enabled / disabled at the system/session level by using.
Alter system/session set SQL-TRACE = TRUE/FALSE.
Explain Plan
- Explain plan command generates information that details the execution plan that will be used on a particular query.
- It uses a pre-created table (PLAN_TABLE) in the current schema to store information about the execution plan chosen by the optimizer.
à Creating the plan table
- Plan table is created by using the script utl x plan, sql
(Oracle Home / RDBMS / admin / uti x plan.sql)
Unix à $ ORACLE_HOME / rdbms / admin
- This script creates an output table, called PLAN-TABLE for holding the output of the explain command.
à Populating the PLAN TABLE
- PLAN TABLE is populated using the explain plan.
SQL> Explain Plan for select * from emp where emp no = 1000;
- This command inserts the execution plan of the SQL statement into the plan table.
- A name tag can be added to explain information by using the set statement_id clause.
Displaying the Execution Plan
- Once the table has been populated, the explain info needs to be retrieved and formatted.
- Number of scripts are available to format the plan table data.
$ ORACLE_HOME / rdbms / admin / utlxpls. Sql – to format serial explain plans.
$ ORACLE_HOME/ rdbms/admin/utlxpil. Sql – to format parallel explain plans.
AUTOTRACE
- The AUTOTRACE facility in SQL* plus allows analysts to view the execution plan d some useful statistics for a SQL statement within a SQL*plus session.
- AUTOTRACE needs to be initiated in the SQL*Plus session prior to executing the statement.
SET AUTOTRACE [OPTIONS] [EXPLAIN] [STATISTICS]
- As with the explain plan command, to obtain an execution plan the PLAN-TABLE must be created in the user’s schema prior to Auto Tracing.
SQL> Set Auto trace trace only explain
SQL> Select * from dual;
- To enable viewing of STATISTICS data, the auto tracing user must have access to dynamic performance tables.
- To achieve this, grant PLUS TRACE role to the user.
PLUS TRACE role is created by the plus trace. Sql script $ ORACLE_HOME / sql plus admin
SYS user must run this script.
DBA can them grant the role to the users who wish to use the AUTOTRACE.
TK PROF
- Tk prof facility accepts as input a SQL Trace File and produces a formatted output file.
- Tk Prof Filename_source filename_output EXPLAIN = [user name / password] sys = [yes/no] TABLE = [Table Name]
A) How do you add trace to a report?
- By usingthe package SRW.TRACE_ADD_OPTION
B) How do you execute a specified DDL in a report?
- BY using the package PW.DO_SQL
C) How do you generate message in reports?
- By using the packages PW.MESSAGE (Reg Num, );
D) Explain BLOBS of CLOBS?
LOBà A LOB is a data type that is used to store large, unstructured data such as text, graphic images, video, clippings etc.
* Four large object data types.
BLOB : Represents a binary large object
CLOB : Represents a character large object
NCLOB: Represents a multibyte character object.
BFILE: Represents a binary file store of in an os binary file outside the data base.
TEMPLATE FORM
- The TEMPLATE form is the required starting point for all development of new forms.
- The development of a new form is started by copying the TEMPLATE.fmb file, located in $ AU_top / forms/ us, to a local directory and renaming it as appropriate.
TEMPLATE FORM CONTAINS THE FOLLOWING:-
* platform-independent references to object groups in the APPSTAND form
(STANDARD_PCAND_VA,
STANDARD_TOOLBAR,
STANDARD_CALENDAR)
*platform-independent attachments of several libraries
FND SQF
APPCORE
APPDAYPK
*several form level triggers with requited code
*program units that include a specification and a body for the package APP_CUSTOM, this contains default behaviors for window opening and closing events.
- In general this code should be modified for the specific form under development.
* The application’s color pallet, containing the two colors required by the referenced visual attributes.
* Many referenced objects that support the calendar, the toolbar, alternative regions and the menu.
* Template form contains simple objects that show typical items and layout cosmetics.
- These are deleted after developing the form
Blocks : Block Name, Detail Block
Window : Block Name
Canvas _view :Block Name
* Template form includes plat form-independent attachments of several libraries.
- Some of the libraries are attached directly to the TEMPLATE (FNDSQF, APPCORE, APPDAYPK) while the others are attached to these libraries.
APPCORE, APPDAYPK, FNDSQF, CUSTOM, GLOBE, VERT, JA, JE, JL
APPCORE
- Contains the packages and procedures that are required for all forms to support the Menu, Toolbar and other required standard behaviors.
- Procedures and functions in APPCORE have names beginning with APP.
APPDAYPK
- Contains the packages that control the Oracle applications calendar feature.
FNDSQF
- Contains packages and procedures for message dictionary, flexfields, profiles and concurrent processing.
- It also has various other utilities for navigation, MRG, WHO etc.
- Procedures and functions have names beginning with FND.
CUSTOM
- Custom library allows extension of Oracle Applications forms without modification of Oracle applications code.
- Custom library can be used for customizations such as ZOOM (Moving to another form from one form and querying up specific records), enforcing business rules.
Ex:- Supplier name must be in upper case) and disabling fields that are not required for a
particular site.
- All logic must branch based on the form and block for which it is run.
- Oracle applications send events to the Custom library.
- Custom code can take effect based on the events.
What is sub query and correlated sub query?
Sub Query :-
- A Sub Query is a SELECT statement that is embedded in a clause of another SQL statement called the parent statement.
- Sub query (Inner Query) returns a value that is used by the outer query.
- Scalar sub query is a sub query that returns exactly one column value from one row.
Correlated Sub Query
- Correlated sub query are used for row – by – row processing.
- Each sub query is executed once for every row of the outer query.
- A correlated sub query is one way of reading (data) every row in a table and comparing values in each row against related data.
- Oracle server performs correlated sub query when the sub query references a column from a table in the parent query.
- The inner query is driven by the outer query in correlated sub queries.
- A correlated sub query is evaluated once for each row processed by the parent statement.
Ex:- Select last_name, salary, department_id from employers OUTER
where salary> (select AVG (Salary) from employees
where department id = outer.department_id);
Which trigger will fire when cursor moves from one block to another block?
WHEN_NEW_BLOCK_INSTANCE
What are the triggers used in CUSTOM.Pll?
CUSTOM.Pll contains (CUSTOM package) the following functions and procedures.
CUSTOM.ZOOM_AVAILABLE à FUNCTION
CUSTOM.STYLEà FUNCTION
CUSTOM.EVENTà PROCEDURE.
* Triggers in Custom.Pll:-
1 WHEN _NEW_FORM_INSTANCE
2 WHEN_FORM_NAVIGATE
3 WHEN_NEW_BLOCK_INSTANCE
4 WHEN_NEW_RECORD_INSTANCE
5 WHEN_NEW_ITEM_INSTANCE
6 ZOOM
7 EXPORT
8 SPECIAL 1-45
9 KEY_Fn (n is a number between 1 and 8)
What is the difference between pre-query and post -query?
* Pre-query executes only once for the statement where as post-query executes for each record.
List of some API’S
FND_PROGRAM.EXECUTABLE
FND_PROGRAM.REGISTER
FND_PROGRAM.PARAMETER
FND_PROGRAM.ADD_TO_GROUP
FND_REQUEST.SUBMIT_REQUEST
FND_PROFILE.VALUE
FND_PROFILE.GET
How to get second parameter value based on first parameter?
$flex$ value setname.
What is Ref Cursor
Ref cursor is a data type and executed at server side and with ref cursor multiple select statements can be executed. By increase the binary size, that number of records that are committed can be increased by using control file.
Forms can be developed in APPS in two ways
A) Customization by extension (using template.fmb)
B) Customization by modification (using custom.pll)
How to call WHO columns into the form
By using FND_STANDARD API’S
1. FND_STANDARD.FORM_INFO
Provides information about the form.
Should be called form when_new_form – instance – instance trigger.
2. FND_standard.set_who
loads WHO columns with proper user information.
Should be called from PRE_UPDATE and PRE_INSERT
Triggers for each block with WHO fields
If this is used FND-GLOBAL need not be called.
(FND_GLOBAL.WHO)
3. FND_STANDARD.SYSTEM_DATE
This is a function which returns date.
Behave exactly like SYSDATE built-in.
4. FND_STANDARD.USER
This is a function which returns varchar2
Behaves exactly like built in USER.
56. How to register a table and columns through back end?
* By using AD_DD package
- for registering a table à AD_DD.REGISTER_TABLE
- for registering columns à AD_DD.REGISTER_COLUMN.
- AD_DD API doesn’t check for the existence of the registered table or column in the data base schema, but only updates the required SQL tables.
- It should be ensured that, all the tables and columns registered exist actually and have the same format as that defined using AD_DD API.
- Views need not be registered.
57. How to write to a file through concurrent program.
* By using FND_FILE package and it can be used only for log and output files.
à FND_FILE package contains procedures to write text to log and output files.
à FND_FILE supports a maximum buffer line size of 32k for both and output files.
1. FND_FILE.PUT
- this is used to write text to a file with out a new line character
- Multilane calls to FND_FILE.PUT will produce consummated text.
Procedure FND_FILE.PUT (which IN Number, Buff IN varchar2);
Which à log output file can be FND_FILE.LOG or FND_FILE.OUTPUT.
2. FND_FILE.PUT_LINE
- this procedure as used to write a line of text to a file followed by a new line character.
Procedure FND_FILE.PUT_LINE (which IN number, buff IN varchar2);
EX:- FND_FILE.PUT_LINE( FND_FILE.LOG, find_message_get);
3. FND_FILE.NEW_LINE
- this procedure is used to write line terminators to a file
procedure FND_FILE.NEW_LINE (which IN number LINES IN NATURAL:=1);
Ex:- to write two newline characters to a log file Fnd_file.new_line (fnd_file.log,2);
4. FND_FILE.PUT_NAMES
- this procedure as used to set the temporary log file and output filenames and the temporary directory to the user specified values.
- This should be called before calling my other FND_FILE procedure and only once per a session.
59. How to display Request ID in the reports?
* By using the parameter P_CONC_REQUEST_ID which needs to be defined always in the reports.
60. How to get username / user id in reports?
- By using the API FND_PROFILE THE OPTION values can be manipulated in client / server profile caches
- FND_PROFILE.GET, FND_GLOBAL.USER_ID, FND_GLOBAL.USER_NAME
- this procedure is located in FNDSQF library.
- This procedure is located to get the current value of the specified user profile option or null if the profile does not exist.
- The server_side PL/SQL package FND_GLOBAL returns the values which need to set who columns for inserts and updates from stored procedures.
- Procedure FND_PROFILE.GET ( name in varchar2, Value out varchar2);
FND_PROFILE.GET (‘USER_ID’, user_id);
* FND_PROFILE.VALUE
- this function exactly works like GET, except it returns the values of the specified profile option as a function result Function FND_PROGILE.VALUE (name in varchar2 Return varchar2;
63. How to checks the request status?
- A PL /SQL procedure can check the status of a concurrent request by calling.
FND_CONCURRENT.GET_REQUEST_STATUS
FND_CONCURRENT.WAIT_FOR_REQUEST
- FND_CONCURRENT.GET_REQUEST_STATUS
- This function returns the status of a concurrent request
- If the request is already computed, it also returns the completion message.
- This function returns both user friendly (translatable) phase and status values as well as developer phase and status vales that can drive program logic.
- when application and program are specified, the request_id of the last request for the specified program should be returned to request_id.
Phase, and status values should be taken from FND_LOOKUPS
dev_phase dev_status
pending normal, standby, scheduled, paused
running normal, waiting, resuming, terminating.
Complete normal, Error, warning, cancelled, terminated
Inactive disabled, on-hold, No-manager, suspended
- this function should be called from a concurrent program to set its completion states.
- This function returns TRUE on success, other wise FALSE.
65. How to convert a form from 4.5 to 6.0?
- To upgrade forms, the form can be directly compiled in the next release.
- Form can be compiled by using ifcmp 60.exe
- FLINT 60 batch executable can be used to check whether the form is compatible to Apps or not.
66. How to call a form from another form?
- to invoke another form with in a form the function security routines should be used which are available in FND_FUNCTION package.
* for this purpose, CALL_FORM built-in can not be used since the Oracle Applications libraries do not support it.
*FND_FUNCTION.EXECUTE should be used to open a new session of a form (CALL_FORM/ OPEN_FORM do not be used)
*APP_NAVIGATE.EXECUTE procedure also can be used to open a form where an instance of the same form is reused, that has already been opened.
*APP_NAVIOGATE.EXECUTE is similar to FND_FUNCTION.EXECUTE, except that is allow a form to be restarted if it is invoked a second time.
*FND_FUNCITON.EXECUTE always starts a new instance of a form.
69. What are the triggers that fire on item?
- Pre_Text_Item
- when_New_Item_Instance
- post_text_Item
- post_Change
- When_validate_Item
- key_Next_Item
- execute fnd_client_info.set_org_contest (‘Org_Id’)
- execute dbms_application_info.set_client_info (‘Org_Id’)
70. Transactional triggers in forms
- Transactional triggers are the triggers that are related to accessing a data source.
- These triggers fire for each record that is marked for insert, update or table when forms would typically insert. Update of delete statements.
- Internally forms would be calling its internal insert_record, update_Record and Delete_Record built_ins as appropriate to perform the default processing.
* Important Transaction triggers are
1. ON_LOCK
2. ON_UPDATE
3. ON_INSERT
4. ON_DELETE
71. Which triggers will fire when cursor moves from one block to another block?
Trigger Firing Order Level
1. Post_Text_Item Item
2. Post_Record Block
3. Post_Block Block
4. When_Create_Record Block
5. Pre_ Block Block
6. Pre_Record Block
7. Pre_Text.Item Block
8. When_New_Block_Instance Block
9. When_New_Record_Instance Block
10. When_new_Item_Instance Form
72. What is the difference between the following triggers are fired
(i) PRE_COMMIT (ii) ON_COMMIT (iii) POST_COMMIT
Pre – Commit Trigger and POST_COMMIT triggers?
* ‘POST_FORMS_COMMIT trigger is the new name for the POST_COMMIT triggers.
*When a form is being committed
These trigger fires once during the Post and Commit transaction process. Before form builder processes any (changes) records to change.
Specifically it fires after form builder determines that there are inserts, updates or deletes in the form to post or commit, but before it commits the changes.
This trigger doesn’t fire when there is an attempt to commit, but validation determines that there are no changed records in the form.
This is a form level trigger.
Enter query mode should be set as ‘No’
This can be used to perform an action, such as setting up special locking requirements, at any time a database commit is going to occur.
If this trigger fails, the post and commit processes fail, no records are written to the database and focus remains in the current item.
If a DML is performed in a pre-commit trigger and it fails, ten manual rollback must be performed, because form builder doesn’t perform an automatic roll back.
This trigger fires in post and commit transactions.
Post – Commit Trigger
This is also known as post-commit trigger.
Post-commit trigger fires once during the post and commit transactions.
If there are records in the form that have been marked as inserts, updates or deletes, the post-forms-commit trigger fires after these changes have been written to the database but before form builder issues the database commit to finalize the transaction.
If the operation or application initiates a commit when there are no records in the form have been marked as inserts, updates or deletes, form builder fires post-forms-commit trigger immediately, without posting changes to the database.
This is a form level trigger.
Enter query mode should be set to ‘No’
Post-forms-commit trigger should be used to perform an action, such as updating an audit trial any time a database commit is about to occur.
If this trigger fails, post and commit processing aborts and form builder issues a ROLLBACK and decrements the internal save point counter.
This trigger fires in Post and Commit transactions.
Can a Report contain more than one template?
Templates define common characteristics and objects that can be applied to multiple reports.
For example template can be defined that include the company logo and sets font colors for selected areas of a report.
When a report is created through the Report Wizard, there is an option of applying a template (.tdf file) to the report.
When a template is chosen, objects in the margin area of a template are imported into the same locations in the current report section, over writing any objects if exists.
The characteristics of the objects in the body area of the template are applied to objects in the body area of the template are applied to objects in the body area of the current report section.
Any template properties, parameters, report triggers, programmed units and attached libraries are also applied.
Different (Multiple) templates can be applied to each section of the report.
If another template is applied later to a report the existing template objects will be deleted in the current report section.
How to add a template to the predefined templates list?
i) In a text editor open the Preferences File
ii) Scroll down to the template descriptions identified by Reports. xxx – Template_Reso (who xxx specified a Report style) (Tabular, Break Above)
iii) For each Report style for which the template is defined
- to the Reports.xxx – Template_Disc list, add the description that should be appeared on the template page of the report wizard.
- To the corresponding Reports. XXX_template_file list, add the file name of the template in the same position as the addition that is made to the description list.
iv) Copy the template file (file name.tdf) to
ORACLE_HOME/REPORT 60/ADMIN/TEMPLATE/US
Preferences file:-
Windows à ORACLE_HOME\CAUPREFS.ORA (user preferences)
ORACLE_HOME\CAGPREFS.ORA (Global Preferences)
Unix à HOME_DIRECOTRY/Prefs.ora (User preferences)
$ORACLE_HOME/tools/admin/prefs.ora( Global Preferences)
78. How to pass a parameter in a request set for three concurrent programs which are having same parameter?
i) For the first report in the Report set, click on the parameters button and enter the parameters that are to the shared by all reports in the Request (Report) set.
ii) Go to the next report and click the parameters button and list the same shared parameters.
iii) Do the above step for each and every report in the request set
iv)’Modify’ check box can be used to allow the users to change the values of the parameters in the ‘lower ’reports at submission time..
v) ‘Display) check box can be used to allow the users to see the parameter values at submission time.
* Request set wizard can be used to quickly create a new Request set in which all of the request run sequentially or all of the request run in parallel.
*sequentially à One after another
* parallel à All at once.
- the action can be set whether to continue processing or abort processing. If a request ends with the statues ‘Error’.
79. What are Global variables in Reports?
*Global variables are the variables that can be assigned to parameters in reports and those parameters can be used in reports
create_parameter_list (------)
add_parameter (----:Global_var);
run_product(….);
80. What are Handlers?
* Handler is a group of packaged procedures which is used by Oracle Applications to organize PL/SQL code in forms.
- Handlers provide a way to centralize the code so that it becomes easier to develop, maintain and debug.
- The packaged procedures available in a handler are called form the triggers by passing the name of the trigger as an argument for the procedure to process.
* Handlers are types :- 1) Item Handlers
2) Event Handlers
3) Table Handlers
4) Business Rules
86. What is a Responsibility?
- Responsibility defines Applications Privileges
- A responsibility is a level of authority in Oracle Applications that lets users only those Oracle Applications functions and data appropriate to their roles in an organization.
- Each user has at list one or more responsibilities and several users can share the same responsibility
* Each responsibility allows access to
- a specific application or a set of applications.
- A set of books
- A restricted list of windows that an user can navigate
- Reports in a specific application.
87. What are security Attributes?
- Security Attributes are used by Oracle self service web Applications to allow rows of data to be visible to specified users responsibilities based on the specific data contained in the row.
88. What is a Profile Option?
- profile options are the set of changeable options that affects how the application looks and behaves.
- By setting profile options, the applications can be made to react in different ways for different users depending on the specific user attributes.
89. What are steps involved in developing a flex field?
- designing the table structure
- creating fields on the form (Visible/Hidden)
- calling appropriate routines
- registration of the flex field.
- Definition of the flex field.
<Flex fields / key/ Register>
<Flex fields/Descriptions / Register>
Nice Thread Suresh... :)
ReplyDeleteKeep it up...