Oracle Financials products provide organizations with solutions to a wide range of long- and short-term
accounting system issues. Regardless of the size of the business, Oracle Financials can meet accounting
management demands with:
Oracle Assets: Ensures that an organization's property and equipment investment is accurate and
that the correct asset tax accounting strategies are chosen.
Oracle General Ledger: Offers a complete solution to journal entry, budgeting, allocations,
consolidation, and financial reporting needs.
Oracle Inventory: Helps an organization make better inventory decisions by minimizing stock and
maximizing cash flow.
Oracle Order Entry: Provides organizations with a sophisticated order entry system for managing
customer commitments.
Oracle Payables: Lets an organization process more invoices with fewer staff members and tighter
controls. Helps save money through maximum discounts, bank float, and prevention of duplicate
payment.
Oracle Personnel: Improves the management of employee- related issues by retaining and making
available every form of personnel data.
Oracle Purchasing: Improves buying power, helps negotiate bigger discounts, eliminates paper
flow, increases financial controls, and increases productivity.
Oracle Receivables:. Improves cash flow by letting an organization process more payments faster,
without off-line research. Helps correctly account for cash, reduce outstanding receivables, and
improve collection effectiveness.
Oracle Revenue Accounting Gives an organization timely and accurate revenue and flexible
commissions reporting.
Oracle Sales Analysis: Allows for better forecasting, planning. and reporting of sales information.
The General Ledger (GL) module is the basis for all other Oracle Financial modules. All other modules
provide information to it. If you implement Oracle Financials, you should switch your current GL system
first.GL is relatively easy to implement. You should go live with it first to give your implementation team a
chance to be familiar with Oracle Financials.
MultiOrg or Multiple Organizations Architecture allows multiple operating units and their relationships to be
defined within a single installation of Oracle Applications. This keeps each operating unit's transaction data
separate and secure.
Use the following query to determine if MultiOrg is intalled:
A field is a position on a form that one uses to enter, view, update, or delete information. A field prompt
describes each field by telling what kind of information appears in the field, or alternatively, what kind of
information should be entered in the field.
A flexfield is an Oracle Applications field made up of segments. Each segment has an assigned name and a
set of valid values. Oracle Applications uses flexfields to capture information about your organization. There
are two types of flexfields: key flexfields and descriptive flexfields.
1. How do I find the list of responsibility assigned to menu. Just the table name will do ?
SELECT responsibility_name
FROM FND_RESPONSIBILITY_VL
WHERE menu_id = (SELECT menu_id
FROM FND_MENUS_VL
WHERE user_menu_name LIKE
'%MENU_NAME%')
2. How many user is using the given menu ?What is the table name to identify he above relations.
The Table to identiy is FND_USER_RESP_GROUPS. From this table, you can get the User_id and then
map it with the FND_USER table to get the user name
3. Relation between the menu and form. What is the table name maintain this relation.
4. Can any one tell how many Key FlexFields are there in Oracle Applications and there names with
Module name.
SELECT fat.application_name,
fif.id_flex_name
FROM fnd_id_flexs fif
JOIN fnd_application_tl fat
ON fat.application_id = fif.application_id
AND fat.language = 'US'
ORDER BY fat.application_name
1. Suppliers
1.i There is more than one account for the same supplier, which one do I choose?
Check the supplier site addresses and choose the supplier whose site address matches your
invoice address. If none of them match your invoice then ask DP section to create a new site. If all
the supplier accounts have the same site addresses then choose the Supplier with the lowest
number. We are in the process of merging all the multiple accounts into one.
Page 3 of 262
Please send details of the supplier or employee to DP section. Minimum details required are as
follows:
Name and full address
If an individual please confirm if the person is an employee or not
Standard forms for full supplier set-up can be obtained from DP section.
2. Batch Headers
Select the batch header you want to print by clicking on Query, and Find. Then enter the batch
number you require and click on the Find button
The system brings up the batch details
Confirm that you have the right folder open ie UCL BATCH HEADER
Click on the Action menu and then click Print
A copy of the batch header would be printed on your printer
You can change the invoice type on the batch header after entering invoices against a batch
and the new invoice type will default onto new invoices entered after the change. Changing the
batch header does not affect invoices entered before the change
You can delete an invoice from a batch at any time before the invoice has been approved. See
5.i
You cannot delete an invoice batch that contains invoices. If you want to delete an invoice
batch, you must delete the invoices in the batch first. See 5.i
3.ii I am unable to enter a grant distribution against a 6P … expenditure type because the
system is requesting for a valid quantity
3.iii I wish to enter a distribution against a grant code but the system is requesting for an
expenditure Item date
In this case you are trying to enter an expense against a completed grant. Please confirm the
completion date of the grant and enter a date on or before the grant completion date. You can
confirm the date as follows:
Select the grant field
Click on the picklist button on the toolbar or press CTRL+F11
Enter the grant code and click the Find button
The system would then bring up brief details about the grant.
Scroll to the right to view the grant completion date.
3.iv I have entered my distributions against grant codes and the system generated account
codes are different from the grant codes that I entered?
Page 4 of 262
The grants were set-up to map to control accounts in the general ledger. The account codes for
these control accounts are different from the grant codes that you have entered. See further details
on COA Philosophy document on the NewFis website
4. VAT Distributions
4.i How do I confirm that the VAT amount is correct before the first level approval process is
run?
4.ii System calculated VAT amount does not agree with the invoice VAT amount due to
rounding differences or insignificant arithmetical errors on Supplier invoices
Manually change the system calculated VAT amount on the VAT distribution line to agree with the
invoice VAT amount.
4.iii Most of our expenses are VAT recoverable, and I am not sure of the VAT codes to use
Recoverability is now defined at the account code level. The code to enter is the one that
corresponds with the VAT rate on your invoice. Please find further details on the VAT
overview document on the Newfis website.
5. Adjusting and deleting invoices and invoice distributions
5.i.i If invoice is unapproved (first level approval has not been done)
Ensure that you are on the invoices window and the cursor is on the invoice line that you wish
to delete
Click on the red X button on your toolbar
Click OK on the delete message box.
Once the deletion is completed save your work.
An approved Invoice cannot be deleted because funds have already been committed against the
invoice during the approval process. However, the system would allow you to cancel the invoice.
On your invoices screen, click on the Actions..1 button and this brings up the Actions wndow.
On the Actions window click on the Cancel Invoice check box
Click OK and click OK to the messages that come up during the cancellation process.
Once the process have been completed save your work
5.iii I have entered an expense claim with the wrong invoice type, how do I correct this error
Delete the invoice and re-enter it with the standard invoice type.
Page 5 of 262
Before approval
Purchase order matched distributions cannot be adjusted but can be reversed and the correcting
entries entered on a new distribution line.
Distribution details that are not generated from purchase orders can be changed or deleted
before the first level approval stage. Follow the procedure for adjusting invoices and remember to
save your work .
Distributions cannot be amended or deleted once they have been approved. The system would
only allow you to reverse the entries by clicking on the Reverse …1 button.
5.v Please see the invoice adjustment chart at the end of this document.
6. Invoice Approval
6.i After running the batch approval process, how do I confirm that all the invoices in the batch have
been approved?
The batch approval process normally takes a few minutes to run. The time it takes depend on
the number of entries in the batch and how busy the system is. Please wait a few minutes
before checking that all the invoices in your batch have been approved.
After waiting for a few minutes you may open the invoices window of the batch and click on
Query, then Run. This refreshes the screen and you may then check if your invoices have been
approved by reviewing the holds placed on them.
If you process large volumes of batches then it is advisable to print the Invoice on Hold report
once or twice a day instead of checking batches individually. See page 45 of your AP training
documentation for guidance on how to print reports.
6.ii I have approved my invoices but don't know where they have gone for secondary approval?
Invoices are automatically available for all authorised signatories in your Department once the First
Level approval is carried out. You do not need to send them to anyone for approval.
6.iii An invoice was not approved in my batch of 10 invoices. Does this stop the rest from being
processed further?
No
7. General advice
7.i It is advisable that you print out or review the Invoice on Hold Report at the end of every day to
ensure that all your invoices were successfully entered.
7.ii You may approve more than one batch at a time. To do this
Navigate to the Invoice batches window
Press the SHIFT key and then click on the invoice batches that you wish to approve. The
batches would become highlighted in blue and the Approve button would indicate the number
of batches that you have highlighted
Lift your finger off the shift key and then click on the approve button
The system would ask you to confirm the number of batches to be approved.
Page 6 of 262
Click OK
7.iii The on screen 'help' is very useful and provides the following information:
Window help: topics relating to the window you are working on
Keyboard help : A list of keyboard shortcuts
View My Request : Confirm the status of your requests
About this Record: Details of who created a record and when it was created
Page 7 of 262
The Invoice document is used to bill the Buyer for services and/or products delivered by the Seller.
Credit is the means by which we are able to obtain immediate benefit of goods or services upon the promise
of payment at a future date.
Buyer
R e c o n c ile C r e a te in v o ic e G e n e ra te
in v o ic e re s p o n s e paym ent
In v o ic e In v o ic e
Marketplace
In v o ic e
R esponse
Is s u e r e s o lu tio n
N m a y ta k e p la c e v ia
p h o n e , e m a il, e tc .
Supplier
M a y in c lu d e
in fo r m a tio n fr o m P ro c e s s R e s o lv e is s u e s
D is p u t e d
fie ld tic k e t( s ) a n d C r e a t e in v o ic e in v o ic e Y a n d re c re a te
a n y th ir d p a rty it e m s ?
re s p o n s e in v o ic e
c h a rg e s
Credit memo: When you want to adjust an invoice, document issued by the vendor to record an adjustment
against an invoice.
Description The supplier presents to the customer for the ordered or delivered, received or consumed
goods or services a detailed invoice. The customer disputes the invoice and works with
supplier to resolve issue. If any discrepancy is found, the customer shall start the process to
treat incorrect invoices. Once Supplier and Customer agree upon the nature of the dispute,
Supplier issues a credit memo to correct the problem. Buyer receives credit memo,
reconciles with order and contract information and issues payment.
Negative = Credit
Positive = Debit
Verify its correctness.
o Note the reason for the credit if it is not clear on the credit memo itself
o Indicate the account and center where the credit should be applied.
o Forward all credits to Accounts Payable immediately so that the credit can be applied to
your cost center and deducted from the next payment to the vendor. DO NOT HOLD
CREDITS IN THE DEPARTMENT FOR ANY REASON.
o Accounts Payable will apply the credit against any open invoices in the system.
o Make a copy for your records.
Debit memo: Negative amount invoice created by us and sent to supplier to notifying him about the credit we
are recording.
Page 8 of 262
AP is divided in to 2 workbenches.
Invoice workbench
Payable workbench
We usually enter supplier invoice either in Invoice workbench or quick invoice window.
Invoice workbench:
Contains:
Invoice Batch window
Invoice window
Distribution window
Other associated windows
When to use:
Incase of complex invoices or invoices that requires online validation.
When an invoice requires immediate action.
Expanse Reports:
Invoice Creation:
Invoice Distributions:
Account: Company have different COA so follow that hierarchy for each set of item.
Accounting Date: Date when we are planning to post it to GL ie. GL Date.
Payments:
Record: Manual payments(checks,wire) which are made out of OP and they will be recorded in Op and
update the invoice for which you have paid.
Computer Generated:
Combined:
Payment:
Lookup: It is a predefined values used as a LOV. In some fields we select a value from a predefined set of
values, In some cases we have defined them in the setup windows such as supplier name,payment terms or
tax codes. Other predefined set of values are Lookup codes.
Navigation:
SetupLookups
Distribution Sets:
It is a predefined set of distribution for a repeated or a same set of distribution form a supplier. We can either
link it to supplier site or we can link it to the invoice.
There are 2 types of distribution sets.
Full Distribution Sets: We will define % amount of the invoice to each distribution line and sum of all lines
must be either 0 or 100. We can enter –ve % values.
Page 9 of 262
Skeleton Distribution Sets: Leave the % field as 0 so that at the time of invoice creation you ca enter amount
in different distribution lines.
Purchase document:
Use Bank window to define internal bank branch from which you disburse payments. For each bank account
we can define payment document for check, EFT, EDI or wire transfer and other payment methods.
3 7839 KING
4 7844 TURNER
7. I know the nvl function only allows the same data type(ie. number or char or date Nvl(comm, 0)), if
commission is null then the text “Not Applicable” want to display, instead of blank space. How do I write the
query?
SQL> select nvl(to_char(comm.),'NA') from emp;
Output :
NVL(TO_CHAR(COMM),'NA')
-----------------------
NA
300
500
NA
1400
NA
NA
8. Oracle cursor : Implicit & Explicit cursors
Oracle uses work areas called private SQL areas to create SQL statements.
PL/SQL construct to identify each and every work are used, is called as Cursor.
For SQL queries returning a single row, PL/SQL declares all implicit cursors.
For queries that returning more than one row, the cursor needs to be explicitly declared.
9. Explicit Cursor attributes
There are four cursor attributes used in Oracle
cursor_name%Found, cursor_name%NOTFOUND, cursor_name%ROWCOUNT, cursor_name%ISOPEN
10. Implicit Cursor attributes
Same as explicit cursor but prefixed by the word SQL
SQL%Found, SQL%NOTFOUND, SQL%ROWCOUNT, SQL%ISOPEN
Tips : 1. Here SQL%ISOPEN is false, because oracle automatically closed the implicit cursor after executing
SQL statements.
: 2. All are Boolean attributes.
11. Find out nth highest salary from emp table
SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP
B WHERE a.sal<=b.sal);
Enter value for n: 2
SAL
---------
3700
12. To view installed Oracle version information
SQL> select banner from v$version;
13. Display the number value in Words
SQL> select sal, (to_char(to_date(sal,'j'), 'jsp'))
from emp;
the output like,
SAL (TO_CHAR(TO_DATE(SAL,'J'),'JSP'))
--------- -----------------------------------------------------
800 eight hundred
1600 one thousand six hundred
1250 one thousand two hundred fifty
If you want to add some text like,
Rs. Three Thousand only.
SQL> select sal "Salary ",
(' Rs. '|| (to_char(to_date(sal,'j'), 'Jsp'))|| ' only.'))
"Sal in Words" from emp
/
Salary Sal in Words
------- ------------------------------------------------------
800 Rs. Eight Hundred only.
1600 Rs. One Thousand Six Hundred only.
1250 Rs. One Thousand Two Hundred Fifty only.
14. Display Odd/ Even number of records
Odd number of records:
select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp);
Page 11 of 262
1
3
5
Even number of records:
select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)
2
4
6
15. Which date function returns number value?
months_between
16. Any three PL/SQL Exceptions?
Too_many_rows, No_Data_Found, Value_Error, Zero_Error, Others
17. What are PL/SQL Cursor Exceptions?
Cursor_Already_Open, Invalid_Cursor
18. Other way to replace query result null value with a text
SQL> Set NULL ‘N/A’
to reset SQL> Set NULL ‘’
19. What are the more common pseudo-columns?
SYSDATE, USER , UID, CURVAL, NEXTVAL, ROWID, ROWNUM
20. What is the output of SIGN function?
1 for positive value,
0 for Zero,
-1 for Negative value.
21. What is the maximum number of triggers, can apply to a single table?
12 triggers.
PL/SQL
Basiscs of PL/SQL
1. What is PL/SQL ?
PL/SQL is a procedural language that has both interactive SQL and procedural programming language
constructs such as iteration, conditional branching.
PL/SQL uses block structure as its basic structure. Anonymous blocks or nested blocks can be used in
PL/SQL.
Datatypes PL/SQL
Some scalar data types such as NUMBER, VARCHAR2, DATE, CHAR, LONG, BOOLEAN.
Some composite data types such as RECORD & TABLE.
6. What are % TYPE and % ROWTYPE ? What are the advantages of using these over datatypes?
% TYPE provides the data type of a variable or a database column to that variable.
% ROWTYPE provides the record type that represents a entire row of a table or view or columns selected in
the cursor.
Page 12 of 262
The advantages are : I. Need not know about variable's data type
ii. If the database definition of a column in a table changes, the data type of a variable changes accordingly.
E.g. TYPE r_emp is RECORD (eno emp.empno% type,ename emp ename %type
);
e_rec emp% ROWTYPE
cursor c1 is select empno,deptno from emp;
e_rec c1 %ROWTYPE.
Objects of type TABLE are called "PL/SQL tables", which are modelled as (but not the same as) database
tables, PL/SQL tables use a primary PL/SQL tables can have one column and a primary key.
Cursors
Cursor is a named private SQL area from where information can be accessed. Cursors are required to
process rows individually for queries returning multiple rows.
There are two types of cursors, Implict Cursor and Explicit Cursor.
PL/SQL uses Implict Cursors for queries.
User defined cursors are called Explicit Cursors. They can be declared and used.
DECLARE CURSOR cursor name, OPEN cursor name, FETCH cursor name INTO or Record types,
CLOSE cursor name.
Cursor for loop implicitly declares %ROWTYPE as loop index,opens a cursor, fetches rows of values from
active set into fields in the record and closes
when all the records have been processed.
The cursor having query as SELECT .... FOR UPDATE gets closed after COMMIT/ROLLBACK.
The cursor having query as SELECT.... does not get closed even after COMMIT/ROLLBACK.
WHERE CURRENT OF clause in an UPDATE,DELETE statement refers to the latest row fetched from a
cursor.
Database Triggers
Database trigger is stored PL/SQL program unit associated with a specific database table. Usages are Audit
data modificateions, Log events transparently, Enforce complex business rules Derive column values
automatically, Implement complex security authorizations. Maintain replicate tables.
17. How many types of database triggers can be specified on a table ? What are they ?
If FOR EACH ROW clause is specified, then the trigger for each Row affected by the statement.
If WHEN clause is specified, the trigger fires according to the retruned boolean value.
18. Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database
Trigger ? Why ?
It is not possible. As triggers are defined for each table, if you use COMMIT of ROLLBACK in a trigger, it
affects logical transaction processing.
19. What are two virtual tables available during database trigger execution ?
20. What happens if a procedure that updates a column of table X is called in a database trigger of the same
table ?
I & ii.
Exception :
Exception is the error handling part of PL/SQL block. The types are Predefined and user_defined. Some of
Predefined execptions are.
CURSOR_ALREADY_OPEN
DUP_VAL_ON_INDEX
NO_DATA_FOUND
TOO_MANY_ROWS
INVALID_CURSOR
INVALID_NUMBER
LOGON_DENIED
NOT_LOGGED_ON
PROGRAM-ERROR
STORAGE_ERROR
TIMEOUT_ON_RESOURCE
VALUE_ERROR
ZERO_DIVIDE
OTHERS.
The PRAGMA EXECPTION_INIT tells the complier to associate an exception with an oracle error. To get an
error message of a specific oracle error.
25. What are the return values of functions SQLCODE and SQLERRM ?
SQLCODE returns the latest code of the error that has occured.
SQLERRM returns the relevant error message of the SQLCODE.
30. What are the modes of parameters that can be passed to a procedure ?
IN,OUT,IN-OUT parameters.
BEGIN
Executable statements.
Exception.
exception handlers
end;
34. Explain how procedures and functions are called in a PL/SQL block ?
The Same procedure name is repeated with parameters of different datatypes and parameters in different
positions, varying number of parameters is called overloading of procedures.
The two parts of package are PACKAGE SPECIFICATION & PACKAGE BODY.
Package Specification contains declarations that are global to the packages and local to the schema.
Package Body contains actual procedures and local declaration of the procedures and cursor declarations.
Page 16 of 262
38. What is difference between a Cursor declared in a procedure and Cursor declared in a package
specification ?
A cursor declared in a package specification is global and can be accessed by other procedures or
procedures in a package.
A cursor declared in a procedure is local to the procedure that can not be accessed by other procedures.
39. How packaged procedures and functions are called from the following?
a. Stored procedure or anonymous block
b. an application program such a PRC *C, PRO* COBOL
c. SQL *PLUS
40. Name the tables where characteristics of Package, procedure and functions are stored ?
FORMS4.0
Display items are similar to text items but store only fetched or assigned values. Operators cannot navigate
to a display item or edit the value it contains.
16. How many maximum number of radio buttons can you assign to a radio group?
17. can you change the default value of the radio button group at run time?
No.
Visual Attributes.
Page 17 of 262
Visual Attributes are the font, color and pattern characteristics of objects that operators see and intract with
in our application.
Window
A window, byitself , can be thought of as an empty frame. The frame provides a way to intract with the
window, including the ability to scroll, move, and resize the window. The content of the window ie. what is
displayed inside the frame is determined by the canvas View or canvas-views displayed in the window at
run-time.
No.
24. List the buil-in routine for controlling window during run-time?
Find_window,
get_window_property,
hide_window,
move_window,
resize_window,
set_window_property,
show_View
26. What built-in is used for changing the properties of the window dynamically?
Set_window_property
Canvas-View
A canvas-view is the background object on which you layout the interface items (text-items, check boxes,
radio groups, and so on.) and boilerplate objects that operators see and interact with as they run your form.
At run-time, operators can see only those items that have been assiged to a specific canvas. Each canvas,
in term, must be displayed in a specfic window.
28. Give the equivalent term in forms 4.0 for the following.
Page, Page 0?
Page - Canvas-View
Page 18 of 262
A content view is the "Base" view that occupies the entire content pane of the window in which it is
displayed.
A stacked view differs from a content canvas view in that it is not the base view for the window to which it is
assigned
31. List the built-in routines for the controlling canvas views during run-time?
Find_canvas
Get-Canvas_property
Get_view_property
Hide_View
Replace_content_view
Scroll_view
Set_canvas_property
Set_view_property
Show_view
Alert
An alert is a modal window that displays a message notifies the operator of some application condition
No
35. What built-in is used for showing the alert during run-time?
Show_alert.
Yes. Set_alert_property.
37. What is the built-in function used for finding the alert?
Find_alert
Editors
Default editor
User_defined editors
system editors.
Edit_text item
show_editor
Tablespace is the amount of disk space you get on the oracle database server to create tables and store
data. Oracle users are like database users for any database server such as MySQL. Normally, one user is
sufficient to full-fill the requirements of a standard web application. Additional users and their rights over your
tablespace can be created and modified from the end-user control panel.
NULL is neither equal to NULL, nor it is not equal to NULL. Any comparison to NULL is evaluated to NULL.
Look at this code example to convince yourself.
"Mutating" means "changing". A mutating table is a table that is currently being modified by an update,
delete, or insert statement. When a trigger tries to reference a table that is in state of flux (being changed), it
is considered "mutating" and raises an error since Oracle should not return data that has not yet reached its
final state.
Another way this error can occur is if the trigger has statements to change the primary, foreign or unique key
columns of the table off which it fires. If you must have triggers on tables that have referential constraints,
the workaround is to enforce the referential integrity through triggers as well. There are several restrictions in
Oracle regarding triggers:
A row-level trigger cannot query or modify a mutating table. (Of course, NEW and OLD still can be
accessed by the trigger) .
A statement-level trigger cannot query or modify a mutating table if the trigger is fired as the result
of a CASCADE delete.
Etc.
The only way to reference an object type between databases is via a database link. Note that it is not
enough to just use "similar" type definitions. Look at this example:
what is Pragmas ?
The PRAGMA keyword is used to give instructions to the compiler. There are four types of pragmas in
PL/SQL:
EXCEPTION_INIT
Tells the compiler to associate the specified error number with an identifier that has been declared
an EXCEPTION in your current program or an accessible package. See the Section 1.10,
"Exception Handling " section for more information on this pragma.
RESTRICT_REFERENCES
Tells the compiler the purity level of a packaged program. The purity level is the degree to which a
program does not read/write database tables and/or package variables. See the Section 1.15,
"Calling PL/SQL Functions in SQL" section for more information on this pragma.
SERIALLY_REUSABLE
Tells the runtime engine that package data should not persist between references. This is used to
reduce per-user memory requirements when the package data is only needed for the duration of
the call and not for the duration of the session. See the Section 1.14, "Packages" section for more
information on this pragma.
AUTONOMOUS_TRANSACTION (Oracle8i )
Tells the compiler that the function, procedure, top-level anonymous PL/SQL block, object method,
or database trigger executes in its own transaction space. See the Section 1.8, "Database
Interaction and Cursors " section for more information on this pragma.
Autonomous transactions execute within a block of code as separate transactions from the outer (main)
transaction. Changes can be committed or rolled back in an autonomous transaction without committing or
rolling back the main transaction. Changes committed in an autonomous transaction are visible to the main
transaction, even though they occur after the start of the main transaction. Changes committed in an
autonomous transaction are visible to other transactions as well. The RDBMS suspends the main
transaction while the autonomous transaction executes:
Kill session:
Show_lov(lov_name);
Synonym : A synonym (synonym-name) is an alias for an object (such as a table). The object does not need
to exist at the time of its creation. Synonyms can't be used in a drop and truncate statements. If this is tried,
it results in a ORA-00942: table or view does not exist.
Truncate: A statement like delete from tablename deletes all records in the table, but it does not free any
space. In order to free the space as well, use truncate. However, truncate can not be rolled back .
truncate table table_name;
truncate cluster cluster_name;
The truncate statement is not the same as the <trunc.html> statement.
trunc (date) trunc (date, 'format-string')
For ER-Diagram:
http://members.iinet.net.au/~lonsdale/docs/erd.pdf
A lookup code is a word or string of characters that you provide for your event listing when it's entered into
the system. This code can then be used to quickly and easily locate the event with a database search. The
code, along with The RideShare Alliance Web site address can be passed out with organizational
documentation and advertisements to let your participants know where to find your ridesharing page.
The lookup code serves another purpose as well. When an event is marked as private it will not come up in
any database query except for the lookup code search. This means that the event cannot be found by
anyone who doesn't have the correct code (It is possible, though unlikely, that someone could guess your
code). This feature should be viewed as a way to keep your event out of normal search results, not as a
guaranteed method of security.
Global Naming
Oracle enforces the requirement that the database.domain portion of the database link name must match the complete
global name of the remote database by setting GLOBAL_NAMES to TRUE in the initialization parameter file initSID.ora.
Page 22 of 262
global_names = TRUE
db_name = SOL1
db_domain = world
Our database link points from the local database SOL3 to the remote database SOL1. Therefore we need the global
database name for SOL1. Ask the remote database administrator for these information or connect to SOL1 and execute
the following query on SOL1:
GLOBAL_NAME
-----------
SOL1.WORLD
We found the database link name 'SOL1.WORLD' for our local database SOL3. Now connect to the local database
database SOL3 as a user, who has the privilege to create a database link and create the following named database link
to SOL1.
$ sqlplus jones/lion@SOL3
With this DB-Link, you (jones/lion) can connect to the remote database SOL1 as user scott/tiger. This user must exist on
the remote database SOL1. Test the database link as user jones/lion from SOL3.
You may ask, what's this strange 'SOL1' in ..... using 'SOL1' means ?. Well this is the so called connect_string (or
net_connect_string in Oracle8i). This string has nothing common with the DB-Link name, but very often the same name
is used. The connect string must be defined in the Net8 configuration file TNSNAMES.ORA, if you don't use Oracle
Names.
#
# TNSNAMES.ORA for SOL3 ###############################
#
SOL1.world = (DESCRIPTION = (ADDRESS = (COMMUNITY = tcp.world)
(PROTOCOL = TCP) (Host = saturn) (Port = 1521))
(CONNECT_DATA = (SID = SOL1) (GLOBAL_NAME = SOL1.world)
(SERVER = DEDICATED)))
Well, now you understand our short story at the beginning of this article. If the DBA on SOL1 changes scott's password to
Page 23 of 262
snake, we have the disaster with our missing sales data ... poor management.
External references
Oracle allows three kinds of external references to DB-links, which are resolved as follows:
o Named Link: The username specified in the link is used. You specify the username and password used to
connect to the remote database (this database link is sometimes called fixed user database link).
o Anonymous Link: The session username is used. If you omit the CONNECT TO clause, the database link uses
the username and password of each user who is connected to the database (this database link is sometimes
called connected user database link).
o Privileged Link: The username of the invoker is used. The current user must be a 'global' user with a valid
account on the remote database for the link to succeed. If the database link is used directly, that is, not from
within a stored object, then the current user is the same as the connected user.
When executing a stored object (such as a procedure, view, or trigger) that initiates a database link,
CURRENT_USER is the username that owns the stored object, and not the username that called the object. For
example, if the database link appears inside procedure SCOTT.show_emp (created by SCOTT), and user
JONES calls procedure SCOTT.show_emp, the current user is SCOTT.
However, if the stored object is an invoker-rights function, procedure, or package (new in Oracle8i), the invoker's
authorization ID is used to connect as a remote user. For example, if the privileged database link appears inside
procedure SCOTT.show_emp (an invoker-rights procedure created by SCOTT), and user JONES calls
procedure SCOTT.show_emp, then CURRENT_USER is JONES and the procedure executes with JONES's
privileges. For more information on invoker-rights functions click here
Besides these often used DB-Links, you can create a database link as PUBLIC. Be very careful with PUBLIC database
links, they may open a door for everybody to a remote database. We suggest, NOT TO USE public database links
without Authentication.
A shared PUPLIC DB-Link with Authentication uses a single network connection to create a PUBLIC database link that
can be shared between multiple users with more security. This DB-Link is available only with the multi-threaded server
configuration.
Example
The AUTHENTICATED clause specifies the username and password (JONES/LION) on the target instance (SOL1). This
clause authenticates the user to the remote server and is required for security. The specified username and password
Page 24 of 262
(JONES/LION) must be a valid username and password on the remote instance (SOL1). The username and password
are used only for authentication. No other operations are performed on behalf of this user.
a. One
b. Two
c. Eight
d. Unlimited
a. True
b. False
5. Assuming a payment term ‘IMMEDIATE’ is attached to a Transaction Type, can we raise an Invoice with
Payment term ’30 Days’ for the transaction type?
a. Yes
b. No
6. In which of the following field, Standard Memo Lines appear as List of values
a. Automatically change the value for all existing customers with the profile class
b. Assign the new value only to new customers
c. Prompt the user whether to update for all customers or only for new customers.
d. None of the above
9. Which is of the following is a mandatory descriptive Flexfield to be defined before importing simple
invoices through Auto Invoice?
10. Name the interface tables used for Auto Invoice Lines and Distributions
11. What are the valid values for the column LINE_TYPE in the interface table?
12. Can the user import invoices with user defined code combinations without using auto accounting?
a. Yes
b. No
Page 25 of 262
13. Which of the following information is not required when the user is importing Credit memos?
a. Transaction Type
b. Customer
c. Payment terms
d. Amount
14. Miscellaneous Receipts can be imported into Oracle Receivables using Auto Lockbox
c. True
d. False
a. Bank
b. Bank Branch
c. Bank Account
d. None of the above
a. $AR_TOP/sql
b. $AR_TOP/out
c. $AR_TOP/reports
d. $AR_TOP/bin
19. Assuming a transaction number is not assigned to a receipt in the transmission file and Auto Cash rules
are not used, the system will
Answers:
1. D
2. Deposits and Guarantees
3. False
4. Bill in Advance and Bill in Arrears
5. Yes
6. A
7. A
8. C
Page 26 of 262
9. A
10. RA_INTERFACE_LINES_ALL and RA_INTERFACE_DISTRIBUTIONS_ALL
11. A
12. LINE,TAX,FREIGHT & CHARGES
13. C
14. B
15. AR_PAYMENTS_INTERFACE_ALL
16. B
17. C
18. D
19. B
20. C
Oracle
1) What are the Back ground processes in Oracle and what are they.
1) This is one of the most frequently asked question.There are basically 9 Processes but in a
general system we need to mention the first five background processes.They do the house keeping activities
for the Oracle and are common in any system.
b) Rollback :: A transaction that retracts any of the changes resulting from SQL statements in
Transaction.
c) SavePoint :: For long transactions that contain many SQL statements, intermediate markers or
savepoints are declared. Savepoints can be used to divide a transaction into smaller points.
d) Rolling Forward :: Process of applying redo log during recovery is called rolling forward.
e) Cursor :: A cursor is a handle ( name or a pointer) for the memory associated with a specific
statement. A cursor is basically an area allocated by Oracle for executing the Sql Statement. Oracle uses an
implicit cursor statement for Single row query and Uses Explicit cursor for a multi row query.
f) System Global Area(SGA) :: The SGA is a shared memory region allocated by the Oracle that contains
Data and control information for one Oracle Instance. It consists of Database Buffer Cache and Redo log
Buffer.
g) Program Global Area (PGA):: The PGA is a memory buffer that contains data and control information for
server process.
g) Database Buffer Cache :: Database Buffer of SGA stores the most recently used blocks of database data.
The set of database buffers in an instance is called Database Buffer Cache.
h) Redo log Buffer :: Redo log Buffer of SGA stores all the redo log entries.
i) Redo Log Files :: Redo log files are set of files that protect altered database data in memory that has
not been written to Data Files. They are basically used for backup when a database crashes.
j) Process :: A Process is a 'thread of control' or mechanism in Operating System that executes
series of steps.
7) How many Integrity Rules are there and what are they
7) There are Three Integrity Rules. They are as follows ::
a) Entity Integrity Rule :: The Entity Integrity Rule enforces that the Primary key cannot be Null
b) Foreign Key Integrity Rule :: The FKIR denotes that the relationship between the foreign key and the
primary key has to be enforced. When there is data in Child Tables the Master tables cannot be deleted.
c) Business Integrity Rules :: The Third Integrity rule is about the complex business processes which cannot
be implemented by the above 2 rules.
15) How many minimum groups are required for a matrix report
15) The minimum number of groups in matrix report are 4
19) What is the difference between candidate key, unique key and primary key
19) Candidate keys are the columns in the table that could be the primary keys and the primary key
is the key that has been selected to identify the rows. Unique key is also useful for identifying the distinct
rows in the table.
Page 29 of 262
20)What is concurrency
20) Cuncurrency is allowing simultaneous access of same data by different users. Locks useful for
accesing the database are
a) Exclusive
The exclusive lock is useful for locking the row when an insert,update or delete is being done.This lock
should not be applied when we do only select from the row.
b) Share lock
We can do the table as Share_Lock as many share_locks can be put on the same resource.
27) Deleting a table will not remove the rows from the table but entry is there in the database dictionary
and it can be retrieved But truncating a table deletes it completely and it cannot be retrieved.
31) What is the Difference between a post query and a pre query
31) A post query will fire for every row that is fetched but the pre query will fire only once.
In extents .
* NON-ISOLATED (default)
* ISOLATED
a) on clear details
b) on populate details
* CASCADE
a) per-delete
b) on clear details
c) on populate details
Restrictions:
The statement you pass to FORMS_DDL may not contain bind variable references in the string, but the
values of bind variables can be concatenated into the string before passing the result to FORMS_DDL.
9 ) What are the types of triggers and how the sequence of firing in text item
9)
Triggers can be classified as Key Triggers, Mouse Triggers ,Navigational Triggers.
Key Triggers :: Key Triggers are fired as a result of Key action.e.g :: Key-next-field, Key-up,Key-Down
Mouse Triggers :: Mouse Triggers are fired as a result of the mouse navigation.e.g. When-mouse-button-
presed,when-mouse-doubleclicked,etc
Navigational Triggers :: These Triggers are fired as a result of Navigation. E.g : Post-Text-item,Pre-text-item.
We also have event triggers like when –new-form-instance and when-new-block-instance.
We cannot call restricted procedures like go_to(‘my_block.first_item’) in the Navigational triggers
But can use them in the Key-next-item.
The Difference between Key-next and Post-Text is an very important question. The key-next is fired as a result of the
key action while the post text is fired as a result of the mouse movement. Key next will not fire unless there is a key
event.
The sequence of firing in a text item are as follows ::
a) pre - text
b) when new item
c) key-next
d) when validate
e) post text
11) What are property classes ? Can property classes have trigger?
11) Property class inheritance is a powerful feature that allows you to quickly define objects that conform to
your own interface and functionality standards. Property classes also allow you to make global changes to
applications quickly. By simply changing the definition of a property class, you can change the definition
of all objects that inherit properties from that class.
Yes . All type of triggers .
* 12 a) If you have property class attached to an item and you have same trigger written for the item .
Which will fire first?
12)Item level trigger fires , If item level trigger fires, property level trigger won't fire. Triggers at the lowest level are
always given the first preference. The item level trigger fires first and then the block and then the Form level trigger.
13) What are record groups ? * Can record groups created at run-time?
13)A record group is an internal Oracle Forms data structure that has a column/row framework similar to a
database table. However, unlike database tables, record groups are separate objects that belong to the
form module in which they are defined. A record group can have an unlimited number of columns of type
CHAR, LONG, NUMBER, or DATE provided that the total number of columns does not exceed 64K.
Record group column names cannot exceed 30 characters.
Programmatically, record groups can be used whenever the functionality offered by a two-dimensional
array of multiple data types is desirable.
TYPES OF RECORD GROUP:
Query Record Group A query record group is a record group that has an associated SELECT statement.
The columns in a query record group derive their default names, data types, and lengths from the database
columns referenced in the SELECT statement. The records in a query record group are the rows retrieved by the
query associated with that record group.
Non-query Record Group A non-query record group is a group that does not have an associated query, but whose
structure and values can be modified programmatically at runtime.
Static Record Group A static record group is not associated with a query; rather, you define its
structure and row values at design time, and they remain fixed at runtime.
15) Can a button have icon and lable at the same time ?
15) -NO
When Mouse Navigate is set to False, Oracle Forms does not perform navigation (and the resulting validation) to
move to the item when an operator activates the item with the mouse.
The following questions might not be asked in an Average Interview and could be asked when the
Interviewer wants to trouble u and go deeppppppppppppp……He cannot go further…..
8) what is precompiler?
8) It is similar to C precompiler directives.
Locking mode :
Specifies when Oracle Forms should attempt to obtain database locks on rows that correspond to queried records in
the form.
a) immediate b) delayed
11) What are savepoint mode and cursor mode properties ? level?
11) Specifies whether Oracle Forms should issue savepoints during a session. This property is included primarily for
applications that will run against non-ORACLE data sources. For applications that will run against ORACLE, use the
default setting.
Cursor mode - define cursur state across transaction
Open/close.
GUI
Reports 2.5
1) How many types of columns are there and what are they
1) Formula columns :: For doing mathematical calculations and returning one value
Summary Columns :: For doing summary calculations such as summations etc.
Place holder Columns :: These columns are useful for storing the value in a variable
5) What is Flex
5) Flex is the property of moving the related fields together by setting the flex property on
6) What are the minimum number of groups required for a matrix report
6) The minimum of groups required for a matrix report are 4
Page 37 of 262
1. What is database?
A database is a logically coherent collection of data with some inherent meaning, representing some aspect
of real world and which is designed, built and populated with data for a specific purpose.
2. What is DBMS?
It is a collection of programs that enables user to create and maintain a database. In other words it is
general-purpose software that provides the users with the processes of defining, constructing and
manipulating the database for various applications.
4. Advantages of DBMS?
Ø Redundancy is controlled.
Ø Unauthorised access is restricted.
Ø Providing multiple user interfaces.
Ø Enforcing integrity constraints.
Ø Providing backup and recovery.
10. How is the data structure of System R different from the relational structure?
Unlike Relational systems in System R
Page 38 of 262
38. How does Tuple-oriented relational calculus differ from domain-oriented relational calculus
The tuple-oriented calculus uses a tuple variables i.e., variable whose only permitted values are tuples of
that relation. E.g. QUEL
The domain-oriented calculus has domain variables i.e., variables that range over the underlying domains
instead of over relation. E.g. ILL, DEDUCE.
Page 40 of 262
52. What are partial, alternate,, artificial, compound and natural key?
Partial Key:
It is a set of attributes that can uniquely identify weak entities and that are related to same owner entity. It is
sometime called as Discriminator.
Alternate Key:
All Candidate Keys excluding the Primary Key are known as Alternate Keys.
Artificial Key:
If no obvious key, either stand alone or compound is available, then the last resort is to simply create a key,
by assigning a unique number to each record or occurrence. Then this is known as developing an artificial
key.
Compound Key:
If no single data element uniquely identifies occurrences within a construct, then combining multiple
elements to create a unique identifier for the construct is known as creating a compound key.
Natural Key:
When one of the data elements stored within a construct is utilized as the primary key, then it is called the
natural key.
53. What is indexing and what are the different kinds of indexing?
Indexing is a technique for determining how quickly specific data can be found.
Types:
Ø Binary search style indexing
Ø B-Tree indexing
Ø Inverted list indexing
Ø Memory resident table
Ø Table indexing
54. What is system catalog or catalog relation? How is better known as?
A RDBMS maintains a description of all the data that it contains, information about every relation and index
that it contains. This information is stored in a collection of relations maintained by the system called
metadata. It is also called data dictionary.
detection algorithms to identify deadlocks that do not really exist. Such situations are called phantom
deadlocks and they lead to unnecessary aborts.
67. What are the primitive operations common to all record management systems?
Addition, deletion and modification.
68. Name the buffer in which all the commands that are typed in are stored
‘Edit’ Buffer
70. Are the resulting relations of PRODUCT and JOIN operation the same?
No.
PRODUCT: Concatenation of every row in one relation with every row in another.
JOIN: Concatenation of rows from one relation and related rows from another.
I/O, Security, Language Processing, Process Control, Storage Management, Logging and Recovery,
Distribution Control, Transaction Control, Memory Management, Lock Management
73. Which part of the RDBMS takes care of the data dictionary? How
Data dictionary is a set of tables and database objects that is stored in a special area of the database and
maintained exclusively by the kernel.
77. Define SQL and state the differences between SQL and other conventional programming Languages
SQL is a nonprocedural language that is designed specifically for data access operations on normalized
relational database structures. The primary difference between SQL and other conventional programming
languages is that SQL statements specify what data operations should be performed rather than how to
perform them.
78. Name the three major set of files on disk that compose a database in Oracle
There are three major sets of files on disk that compose a database. All the files are binary. These are
Ø Database files
Ø Control files
Ø Redo logs
The most important of these are the database files where the actual data resides. The control files and the
redo logs support the functioning of the architecture itself.
All three sets of files must be present, open, and available to Oracle for any data on the database to be
useable. Without these files, you cannot access the database, and the database administrator might have to
recover some or all of the database using a backup, if there is one.
80. What are the four Oracle system processes that must always be up and running for the database to be
useable
The four Oracle system processes that must always be up and running for the database to be useable
include DBWR (Database Writer), LGWR (Log Writer), SMON (System Monitor), and PMON (Process
Monitor).
81. What are database files, control files and log files. How many of these files should a database have at
least? Why?
Database Files
The database files hold the actual data and are typically the largest in size. Depending on their sizes, the
tables (and other objects) for all the user accounts can go in one database file—but that's not an ideal
situation because it does not make the database structure very flexible for controlling access to storage for
different users, putting the database on different disk drives, or backing up and restoring just part of the
database.
You must have at least one database file but usually, more than one files are used. In terms of accessing
and using the data in the tables and other objects, the number (or location) of the files is immaterial.
The database files are fixed in size and never grow bigger than the size at which they were created
Control Files
The control files and redo logs support the rest of the architecture. Any database must have at least one
control file, although you typically have more than one to guard against loss. The control file records the
name of the database, the date and time it was created, the location of the database and redo logs, and the
synchronization information to ensure that all three sets of files are always in step. Every time you add a
Page 44 of 262
new database or redo log file to the database, the information is recorded in the control files.
Redo Logs
Any database must have at least two redo logs. These are the journals for the database; the redo logs
record all changes to the user objects or system objects. If any type of failure occurs, the changes recorded
in the redo logs can be used to bring the database to a consistent state without losing any committed
transactions. In the case of non-data loss failure, Oracle can apply the information in the redo logs
automatically without intervention from the DBA.
The redo log files are fixed in size and never grow dynamically from the size at which they were created.
83. What is Oracle Block? Can two Oracle Blocks have the same address?
Oracle "formats" the database files into a number of Oracle blocks when they are first created—making it
easier for the RDBMS software to manage the files and easier to read data into the memory areas.
The block size should be a multiple of the operating system block size. Regardless of the block size, the
entire block is not available for holding data; Oracle takes up some space to manage the contents of the
block. This block header has a minimum size, but it can grow.
These Oracle blocks are the smallest unit of storage. Increasing the Oracle block size can improve
performance, but it should be done only when the database is first created.
Each Oracle block is numbered sequentially for each database file starting at 1. Two blocks can have the
same block address if they are in different database files.
85. Name two utilities that Oracle provides, which are use for backup and recovery.
Along with the RDBMS software, Oracle provides two utilities that you can use to back up and restore the
database. These utilities are Export and Import.
The Export utility dumps the definitions and data for the specified part of the database to an operating
system binary file. The Import utility reads the file produced by an export, recreates the definitions of objects,
and inserts the data
If Export and Import are used as a means of backing up and recovering the database, all the changes made
to the database cannot be recovered since the export was performed. The best you can do is recover the
database to the time when the export was last performed.
86. What are stored-procedures? And what are the advantages of using them.
Stored procedures are database objects that perform a user defined operation. A stored procedure can have
a set of compound SQL statements. A stored procedure executes the SQL commands and returns the result
to the client. Stored procedures are used to reduce network traffic.
87. How are exceptions handled in PL/SQL? Give some of the internal exceptions' name
PL/SQL exception handling is a mechanism for dealing with run-time errors encountered during procedure
execution. Use of this mechanism enables execution to continue if the error is not severe enough to cause
procedure termination.
The exception handler must be defined within a subprogram specification. Errors cause the program to raise
an exception with a transfer of control to the exception-handler block. After the exception handler executes,
control returns to the block in which the handler was defined. If there are no more executable statements in
the block, control returns to the caller.
User-Defined Exceptions
PL/SQL enables the user to define exception handlers in the declarations area of subprogram specifications.
Page 45 of 262
In addition to this list of exceptions, there is a catch-all exception named OTHERS that traps all errors for
which specific error handling has not been established.
(a) i & iii because theta joins are joins made on keys that are not primary keys.
(a) is in 1NF since (AC)+ = { A, B, C} hence AC is the primary key. Since C B is a FD given, where neither C
is a Key nor B is a prime attribute, this it is not in 3NF. Further B is not functionally dependent on key AC
thus it is not in 2NF. Thus the given FDs is in 1NF.
94. Select 'NORTH', CUSTOMER From CUST_DTLS Where REGION = 'N' Order By
CUSTOMER Union Select 'EAST', CUSTOMER From CUST_DTLS Where REGION = 'E' Order By
CUSTOMER
The above is
a) Not an error
b) Error - the string in single quotes 'NORTH' and 'SOUTH'
c) Error - the string should be in double quotes
d) Error - ORDER BY clause
(d) Error - the ORDER BY clause. Since ORDER BY clause cannot be used in UNIONS
102. What is cold backup and hot backup (in case of Oracle)?
Ø Cold Backup:
It is copying the three sets of files (database files, redo logs, and control file) when the instance is shut
down. This is a straight file copy, usually from the disk directly to tape. You must shut down the instance to
guarantee a consistent copy.
If a cold backup is performed, the only option available in the event of data file loss is restoring all the files
from the latest backup. All work performed on the database since the last backup is lost.
Ø Hot Backup:
Some sites (such as worldwide airline reservations systems) cannot shut down the database while making a
backup copy of the files. The cold backup is not an available option.
So different means of backing up database must be used — the hot backup. Issue a SQL command to
indicate to Oracle, on a tablespace-by-tablespace basis, that the files of the tablespace are to backed up.
The users can continue to make full use of the files, including making changes to the data. Once the user
has indicated that he/she wants to back up the tablespace files, he/she can use the operating system to
copy those files to the desired backup destination.
The database must be running in ARCHIVELOG mode for the hot backup option.
If a data loss failure does occur, the lost database files can be restored using the hot backup and the online
and offline redo logs created since the backup was done. The database is restored to the most consistent
state without any loss of committed transactions.
103. What are Armstrong rules? How do we say that they are complete and/or sound
The well-known inference rules for FDs
Ø Reflexive rule :
If Y is subset or equal to X then X Y.
Ø Augmentation rule:
If X Y then XZ YZ.
Ø Transitive rule:
If {X Y, Y Z} then X Z.
Ø Decomposition rule :
If X YZ then X Y.
Ø Union or Additive rule:
If {X Y, X Z} then X YZ.
Ø Pseudo Transitive rule :
If {X Y, WY Z} then WX Z.
Of these the first three are known as Amstrong Rules. They are sound because it is enough if a set of FDs
satisfy these three. They are called complete because using these three rules we can generate the rest all
inference rules.
104. How can you find the minimal key of relational schema?
Minimal key is one which can identify each tuple of the given relation schema uniquely. For finding the
minimal key it is required to find the closure that is the set of all attributes that are dependent on any given
set of attributes under the given set of functional dependency.
Algo. I Determining X+, closure for X, given set of FDs F
1. Set X+ = X
2. Set Old X+ = X+
3. For each FD Y Z in F and if Y belongs to X+ then add Z to X+
4. Repeat steps 2 and 3 until Old X+ = X+
FAQ In SQL
1. Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
Data Definition Language (DDL)
5. What is the parameter substitution symbol used with INSERT INTO command?
&
6. Which command displays the SQL command in the SQL buffer, and then executes it?
RUN
7. What are the wildcards used for pattern matching?
_ for single character substitution and % for multi-character substitution
9. State true or false. !=, <>, ^= all denote the same operation.
True
10. What are the privileges that can be granted on a table by a user to others?
Insert, update, delete, select, references, index, execute, alter, all
11. What command is used to get back the privileges offered by the GRANT command?
REVOKE
12. Which system tables contain information on privileges granted and privileges obtained?
USER_TAB_PRIVS_MADE, USER_TAB_PRIVS_RECD
13. Which system table contains information on constraints on all the tables created?
Page 49 of 262
USER_CONSTRAINTS
16. What command is used to create a table by copying the structure of another table?
Answer :
CREATE TABLE .. AS SELECT command
Explanation :
To copy only the structure, the WHERE clause of the SELECT command should contain a FALSE statement
as in the following.
CREATE TABLE NEWTABLE AS SELECT * FROM EXISTINGTABLE WHERE 1=2;
If the WHERE condition is true, then all the rows or rows satisfying the condition will be copied to the new
table.
17. What will be the output of the following query?
SELECT REPLACE(TRANSLATE(LTRIM(RTRIM('!! ATHEN !!','!'), '!'), 'AN', '**'),'*','TROUBLE') FROM DUAL;
TROUBLETHETROUBLE
20. Which date function is used to find the difference between two dates?
MONTHS_BETWEEN
22. What is the advantage of specifying WITH GRANT OPTION in the GRANT command?
The privilege receiver can further grant the privileges he/she has obtained from the owner to any other user.
23. What is the use of the DROP option in the ALTER TABLE command?
It is used to drop constraints specified on the table.
24. What is the value of ‘comm’ and ‘sal’ after executing the following query if the initial value of ‘sal’ is
10000?
UPDATE EMP SET SAL = SAL + 1000, COMM = SAL*0.1;
sal = 11000, comm = 1000
The query SELECT * FROM EMP ORDER BY ENAME DESC will display the output sorted on ENAME in
descending order.
27. Which function is used to find the largest integer less than or equal to a specific value?
FLOOR
SQL – QUERIES
I. SCHEMAS
Table 1 : STUDIES
Table 2 : SOFTWARE
PNAME (VARCHAR), TITLE (VARCHAR), DEVIN (VARCHAR), SCOST (NUMBER), DCOST (NUMBER),
SOLD (NUMBER)
Table 3 : PROGRAMMER
PNAME (VARCHAR), DOB (DATE), DOJ (DATE), SEX (CHAR), PROF1 (VARCHAR), PROF2 (VARCHAR),
SAL (NUMBER)
Oracle
1) What are the Back ground processes in Oracle and what are they.
1) This is one of the most frequently asked question. There are basically 9 Processes but in a general
system we need to mention the first five background processes. They do the house keeping activities for the
Oracle and are common in any system.
The various background processes in oracle are
a) Data Base Writer(DBWR) :: Data Base Writer Writes Modified blocks from Database buffer cache to
Data Files. This is required since the data is not written whenever a transaction is commited.
b)LogWriter(LGWR) :: LogWriter writes the redo log entries to disk. Redo Log data is generated in redo log
buffer of SGA. As transaction commits and log buffer fills, LGWR writes log entries into an online redo log
file.
c) System Monitor(SMON) :: The System Monitor performs instance recovery at instance startup. This is
useful for recovery from system failure.
d)Process Monitor(PMON) :: The Process Monitor performs process recovery when user process fails.
PMON Clears and Frees resources that process was using.
e) CheckPoint(CKPT) :: At Specified times, all modified database buffers in SGA are written to data files by
DBWR at Checkpoints and Updating all data files and control files of database to indicate the most recent
checkpoint
f)Archieves(ARCH) :: The Archiver copies online redo log files to archival storal when they are busy.
g) Recoveror(RECO) :: The Recoveror is used to resolve the distributed transaction in network
h) Dispatcher (Dnnn) :: The Dispatcher is useful in Multi Threaded Architecture
i) Lckn :: We can have upto 10 lock processes for inter instance locking in parallel sql.
Page 51 of 262
7) How many Integrity Rules are there and what are they
7) There are Three Integrity Rules. They are as follows ::
a) Entity Integrity Rule :: The Entity Integrity Rule enforces that the Primary key cannot be Null
b) Foreign Key Integrity Rule :: The FKIR denotes that the relationship between the foreign key and the
primary key has to be enforced. When there is data in Child Tables the Master tables cannot be deleted.
c) Business Integrity Rules :: The Third Intigrity rule is about the complex business processes which cannot
be implemented by the above 2 rules.
15) How many minimum groups are required for a matrix report
15) The minimum number of groups in matrix report are 4
19) What is the difference between candidate key, unique key and primary key
19) Candidate keys are the columns in the table that could be the primary keys and the primary key is the
key that has been selected to identify the rows. Unique key is also useful for identifying the distinct rows in
the table.
Data Block :: One Data Block correspond to specific number of physical database space
Extent :: Extent is the number of specific number of contiguous data blocks.
Segments :: Set of Extents allocated for Extents. There are three types of Segments
a) Data Segment :: Non Clustered Table has data segment data of every table is stored in cluster data
segment.
b) Index Segment :: Each Index has index segment that stores data
c) Roll Back Segment :: Temporarily stores 'undo' information
31) What is the Difference between a post query and a pre query
31) A post query will fire for every row that is fetched but the pre query will fire only once.
* ROWID
* ROWNUM
* NON-ISOLATED (default)
* ISOLATED
a) on clear details
b) on populate details
* CASCADing
a) pre-delete
b) on clear details
c) on populate details
Restrictions :: The statement you pass to FORMS_DDL may not contain bind variable references in the string, but the
values of bind variables can be concatenated into the string before passing the result to FORMS_DDL.
9 ) What are the types of triggers and how the sequence of firing in text item
9) Triggers can be classified as Key Triggers, Mouse Triggers, Navigational Triggers.
Key Triggers :: Key Triggers are fired as a result of Key action. e.g :: Key-next-field, Key-up,Key-Down
Mouse Triggers :: Mouse Triggers are fired as a result of the mouse navigation.e.g. When-mouse-button-
presed,when-mouse-doubleclicked,etc
Navigational Triggers :: These Triggers are fired as a result of Navigation. E.g : Post-Text-item,Pre-text-item.
We also have event triggers like when –new-form-instance and when-new-block-instance.
We cannot call restricted procedures like go_to (‘my_block.first_item’) in the Navigational triggers But can use them in
the Key-next-item.
***The Difference between Key-next and Post-Text is a very important question. The key-next is fired as a result of
the key action while the post text is fired as a result of the mouse movement. Key next will not fire unless there is a
key event.
The sequence of firing in a text item are as follows ::
a) pre – text-item
b) when-new-item-Instance
c) key-next-item
d) when-validate-item
e) post-text-item
11) What are property classes ? Can property classes have triggers?
11) Property class inheritance is a powerful feature that allows you to quickly define objects that conform to your own
interface and functionality standards. Property classes also allow you to make global changes to applications quickly.
By simply changing the definition of a property class, you can change the definition of all objects that inherit
properties from that class.
Yes . All type of triggers .
* 12) If you have property class attached to an item and you have same trigger written for the item. Which will fire
first?
12) Item level trigger fires, If item level trigger fires, property level trigger won't fire. Triggers at the lowest level are
always given the first preference. The item level trigger fires first and then the block and then the Form level trigger.
13) What are record groups? * Can record groups be created at run-time?
13) A record group is an internal Oracle Forms data structure that has a column/row framework similar to a database
table. However, unlike database tables, record groups are separate objects that belong to the form module in which
they are defined. A record group can have an unlimited number of columns of type CHAR, LONG, NUMBER, or
DATE provided that the total number of columns does not exceed 64K.
Record group column names cannot exceed 30 characters.
Programmatically, record groups can be used whenever the functionality offered by a two-dimensional array of
multiple data types is desirable.
Page 57 of 262
15) Can a button have icon and label at the same time?
15) -NO
The following questions might not be asked in an Average Interview and could be asked when the
Interviewer wants to trouble u and go deeppppppppppppp……He cannot go further…..
8) what is precompiler?
8) It is similar to C precompiler directives.
Locking mode : Specifies when Oracle Forms should attempt to obtain database locks on rows that correspond to
queried records in the form.
a) immediate b) delayed
11) What are savepoint mode and cursor mode properties ? level?
11) Specifies whether Oracle Forms should issue savepoints during a session. This property is included primarily for
applications that will run against non-ORACLE data sources. For applications that will run against ORACLE, use the
default setting.
Cursor mode - define cursur state across transaction
Open/close.
OPEN_FORM : When you call a form, Oracle Forms issues a savepoint for the called form. If the CLEAR_FORM
function causes a rollback when the called form is current, Oracle Forms rolls back uncommitted changes to this
savepoint.
NEW_FORM : Exits the current form and enters the indicated form. The calling form is terminated as the parent
form. If the calling form had been called by a higher form, Oracle Forms keeps the higher call active and treats it as a
call to the new form. Oracle Forms releases memory (such as database cursors) that the terminated form was using.
Oracle Forms runs the new form with the same Runform options as the parent form. If the parent form was a called
form, Oracle Forms runs the new form with the same options as the parent form.
GUI
Reports 2.5
7) How many types of columns are there and what are they
3) Formula columns :: For doing mathematical calculations and returning 1 value
Summary Columns :: For doing summary calculations such as summations etc.
Place holder Columns :: These columns are useful for storing the value in a variable
12) What are the minimum number of groups required for a matrix report
7) The minimum of groups required for a matrix report are 4
Combination Forms: General forms where you can enter the combination of different segment to constitute a
flexfield.
Form with foreign key reference: Forms whose base table foreign key reference to the combination table.
Basically these type of forms uses flexfeild, such as entereing orders, receiving parts etc.
Form with key flexfield range:
Page 62 of 262
For using dynamic insertion we should not define any mandatory application specific column in this table.
Reference fields: Fields are used for storing context information of DFF.
ATTRIBUTE_CATEGORY column is used for storing DFF.
Page 63 of 262
Adding FF to forms:
Create table:
create table test_Flex_Field
(Acc_ID Number(38) Not Null,
segment1 varchar2(60),
segment2 varchar2(60),
segment3 varchar2(60),
segment4 varchar2(60),
segment5 varchar2(60),
segment6 varchar2(60),
segment7 varchar2(60),
segment8 varchar2(60),
segment9 varchar2(60),
Summery_Flag varchar2(1) Not Null,
Enable_Flag varchar2(1) Not Null,
Start_Date_Active Date Not Null,
End_Date_Active Date Not Null,
Last_Update_Date Date Not Null,
Last_Update_By Number(15) Not Null,
CREATION_DATE DATE,
CREATED_BY NUMBER(15),
LAST_UPDATE_LOGIN NUMBER(15))
execute
AD_DD.register_table(Application_short_name,Table_name,p_tab_type,P_pct_free,
P_pct_used);
execute AD_DD.register_table('FND','TEST_FLEX_FIELD','T',8,10,90);
Page 64 of 262
execute
AD_DD.register_column('FND','TEST_FLEX_FIELD','ACC_ID',1,'NUMBER',38,'N','N');
execute
AD_DD.register_column('FND','TEST_FLEX_FIELD','SEGMENT1',2,'VARCHAR2',60,'Y','
N');
execute
AD_DD.register_column('FND','TEST_FLEX_FIELD','SEGMENT2',3,'VARCHAR2',60,'Y','
N');
execute
AD_DD.register_column('FND','TEST_FLEX_FIELD','SEGMENT3',4,'VARCHAR2',60,'Y','
N');
execute
AD_DD.register_column('FND','TEST_FLEX_FIELD','SEGMENT4',5,'VARCHAR2',60,'Y','
N');
execute
AD_DD.register_column('FND','TEST_FLEX_FIELD','SEGMENT5',6,'VARCHAR2',60,'Y','
N');
execute
AD_DD.register_column('FND','TEST_FLEX_FIELD','SEGMENT6',7,'VARCHAR2',60,'Y','
N');
execute
AD_DD.register_column('FND','TEST_FLEX_FIELD','SEGMENT7',8,'VARCHAR2',60,'Y','
N');
execute
AD_DD.register_column('FND','TEST_FLEX_FIELD','SEGMENT8',9,'VARCHAR2',60,'Y','
N');
execute
AD_DD.register_column('FND','TEST_FLEX_FIELD','SEGMENT9',10,'VARCHAR2',60,'Y','
N');
execute
AD_DD.register_column('FND','TEST_FLEX_FIELD','CREATION_DATE',17,'DATE',9,'N','
N');
For finding the application long name see table fnd_Application_Tl and for short name see fnd_Application.
Page 65 of 262
Page 66 of 262
execute AD_DD.register_table('FND','TEST_STATE','T',8,10,90);
execute AD_DD.register_column('FND','TEST_STATE','STATE_NAME',1,'VARCHAR2',60,'Y','N');
execute AD_DD.register_column('FND','TEST_STATE','STATE_ID',2,'VARCHAR2',60,'N','N');
6. What are some methods for transferring a table from one schema to another?
Export-Import, Create table as .. Select .., Copy
7. What happens if a tablespace clause is left off a primary key constraint?
This results in the index automatically generated being placed in the users' default tablespace, which is
usually the same tablespace as where the table is being created which can cause performance problems.
8. Where is most tuning done?
80-90 percent at application level, 10-20 percent at database level
9. What is a mutating table?
A mutating table is a table that is in the process of being modified by an UDPATE, DELETE or INSERT
statement. For example, if your trigger contains a select statement or an update statement referencing the
table it is triggering off of you will receive the error.
10. What is a bind variable and why is it important?
A bind variable is a placeholder in a query. The way the Oracle shared pool (a very important shared
memory data structure) operates is predicated on developers using bind variables.
11. How are reads and writes handled in Oracle that is different than almost every other database?
Reads are not blocked by writes.
12. Why should you care about the NLS_DATE_FORMAT?
Because its' value (dd-mon-yy or dd-mon-rr) determines the results of your date arithmetic when you are
dealing with years of 99 and 00..nn.
13. What is the purpose of the SUBSTR string function?
To return a specified substring from a string.
An equijoin does an equality test between two fields in two different tables;
a self join does the same thing on a copy of the same table.
15. In a Select statement, what is the difference between a & and &&?
Both pass in values at runtime, but if the && is used the user will not be bothered with a second prompt for
the value.
Page 69 of 262
1. They are manipulated through specific statements in the block's executable actions. 2. They individually
process each row returned by a multi row SELECT statement. 3. They need to be declared and named
before they can be used.
1. You can use parameters to pass values to a cursor when it is open. 2. Parameters are used in a query
when it executes. 3. In the OPEN statement, each formal parameter in the cursor declaration must have a
corresponding real parameter.
69. Name three things true about trapping exceptions
1. When an exception occurs, PL/SQL processes only one handler before leaving the block. 2. If you use the
OTHERS clause, it should be placed last of all the exception-handling clauses. 3. Exceptions cannot appear
in assignment statements or SQL statements.
70. Describe two aspects about exceptions.
1. Once an Oracle error occurs, the associated exception is raised automatically.
2. You can raise an exception explicitly by issuing the RAISE statement within the block.
71. What exception occurs when the conversion of a character string to number fails? INVALID_NUMBER
72. Name three things about user-defined exceptions.
1. When defining your own exceptions, you need to declare them in the DECLARE section of a PL/SQL
block. 2. They are raised explicitly with RAISE statements. 3. You need to reference your declared exception
within the corresponding exception-handling routine.
73. What's another Best Practice? Set standards and guidelines for your application before anyone starts
writing code. 1. Selection of development tools 2. How SQL is written in PL/SQL code. 3. How the exception
handling architecture is designed. 4. Processes for code review and testing.
74. Explain the relationship between a Conceptual Data Model (CDM) and a Physical Data Model (PDM).
Most of the objects in the logical model correspond to a related object in the physical model, e.g. the logical
model contains entities, attributes, and key groups, which are represented in the physical model as tables,
columns, and indexes, respectively. The CDM allows the designer to concentrate solely on defining the
objects in the information system and the relationships between them, without having to consider the
numerous parameters associated with the physical implementation such as data integrity constraints, data
access speed and data storage efficiency. The CDM thus provides a clear and succinct picture of the
information system, which is independent of the targeted DBMS. A single CDM may therefore be associated
with a number of PDMs targeting different DBMSs. The conceptual level schema, should present to the user
a simple, physical implementation-independent clear view of the format of the data sets and their
descriptions. A Conceptual Data Model lays the foundation for building shared databases and re-engineering
the business.
75. Elaborating on 74, describe conceptual vs logical vs physical designs.
Conceptual database design is the process of building a model of the essential part of the enterprise
business process and the used information, independent of all physical considerations. Logical database
design - The process of constructing a model of information used in an enterprise based on a specific data
model, using natural objects of information and natural associations between them. The model of
information is independent of a particular implementation and other physical consideration. Physical
database design - The process of producing a description of the implementation of the database on
secondary storage. It describes the storage structures and access methods used to achieve efficient access
to the data.
76. What is a pseudo-column? A pseudo-column is a "column" that yields a value when selected, but which
is not an actual column of the table. 77. What are the more common pseudo-columns? sequence.CurrVal,
sequence.NextVal, RowID, RowNum, SysDate, UID, User
84. When is the MINUS keyword used? To remove those rows which are retrieved by one SELECT from
those retrieved by another SELECT statement.
85. Give an example of the MINUS keyword.
List the numbers of all managers who do not hold advanced degrees. SELECT MGRNO FROM DEPT
WHERE MGRNO IS NOT NULL MINUS SELECT EMPNO FROM EMP WHERE EDLEVEL >= 18;
86. When is the INTERSECT keyword used?
To return only those rows that are the result of two or more SELECT statements.
87. Give an example of the INTERSECT keyword. List the numbers of all managers who do not hold
advanced degrees.
SELECT MGRNO FROM DEPT WHERE MGRNO IS NOT NULL INTERSECT SELECT EMPNO FROM
EMP WHERE EDLEVEL < 18;
88. Write a query to find the duplicate record(s) of column a, b and c in a table of columns a..z. SELECT
count(*), a, b, c FROM t GROUP BY a, b, c HAVING COUNT(*) > 1; 89. Give an example of the NOT
keyword. SELECT c FROM t WHERE c != 'x'; SELECT c FROM t WHERE NOT c = 'x';
90. Give an example of the LIKE keyword. SELECT c FROM t WHERE c LIKE '_EU%L'; ie the first character
can be any character, the next two must be EU and the last must be L. Any number of chararcters or
numbers could be between the U and L.
91. What is SQLCODE?
A predefined symbol that contains the Oracle error status of the previously executed PL/SQL statement. If a
SQL statement executes without errors, SQLCODE is equal to 0.
92. What is SQLERRM?
A PL/SQL symbol that contains the error message associated with SQLCODE. If a SQL statement executes
successfully, SQLCODE is equal to 0 and SQLERRM contains the string ORA-0000: normal, successful
completion
93. What is ROWNUM?
A pseudocolumn that indicates the order of the retrieved row. The ROWNUM for the first returned row is 1,
ROWNUM can limit the number of rows that are returned by a query.
94. What are the benefits of using the PLS_INTEGER Datatype in PL/SQL? If you have a whole-number
counter, for example in a loop or record counter, consider using a datatype of PLS_INTEGER instead of
INTEGER or NUMBER. When declaring an integer variable, PLS_INTEGER is the most efficient numeric
datatype because its values require less storage than INTEGER or NUMBER values, which are represented
internally as 22-byte Oracle numbers. Also, PLS_INTEGER operations use machine arithmetic, so they are
faster than BINARY_INTEGER, INTEGER, or NUMBER operations, which use library arithmetic. Jayanta
Sengupta Lowell, Massachusetts
95. Explain the difference between NVL and NVL2.
NVL (expr1, expr2);
NVL - If expr1 is null then return expr2 else return expr1.
NVL2 (expr1, expr2, expr3)
NVL2 - If expr1 is not null then the function will return expr2. Otherwise, the function will return expr3. The
expr1 can have any datatype and arguments expr2 and expr3 can be of any datatype other than LONG. The
datatype of the return value is that of expr2.
96. Describe RTRIM.
RTRIM (string [,'set']) RTRIM is the opposite of RPAD and similar to LTRIM. The function removes
characters from the right-hand portion of a string. The string passed as the first parameter is returned with all
characters contained in the string passed as the second parameter removed from the right of the last
character not found in the remove string. The second parameter is optional and defaults to a single space.
rtrim('ORACLE UPDATE ') --> 'ORACLE UPDATE'
rtrim('ORACLE UPDATE','EDATPU') --> 'ORACLE '
rtrim('ORACLE UPDATE',' EDATPU') --> 'ORACL'
97. Describe UNION and UNION ALL.
UNION returns distinct rows selected by both queries while UNION ALL returns all the rows. Therefore, if the
table has duplicates, UNION will remove them. If the table has no duplicates, UNION will force a sort and
cause performance degradation as compared to UNION ALL.
98. What is 1st normal form?
Each cell must be one and only one value, and that value must be atomic: there can be no repeating groups
in a table that satisfies first normal form.
99. What is 2nd normal form?
Every nonkey column must depend on the entire primary key.
100. What is 3rd normal form? (another explanation than #1)
No nonkey column depends on another nonkey column.
101. What is 4th normal form?
Page 73 of 262
Fourth normal form forbids (prohibits, prevents) independent one-to-many relationships between primary key
columns and nonkey columns.
102. What is 5th normal form?
Fifth normal form breaks tables into the smallest possible pieces in order to eliminate all redundancy within a
table. Tables normalized to this extent consist of little more than the primary key.
103. What does pragma mean to Oracle? A pragma is simply a compiler directive, a method to instruct the
compiler to perform some compilation option.
104. What is a Latch? A Latch is a low level serialization mechanism that (released as quickly as it is
acquired) protects shared data structures. A process acquires and holds the latch as long as the data
structure is in use. The basic idea is to prevent concurrent access to shared data structures in the SGA. In
case the process dies without releasing the latch, the PMON process will clean up the lock on the data
structure and release the latch. If a process is not able to obtain a latch, it must wait for the latch to be freed
up by the process holding it. This causes additional spinning (looking for availability at fixed intervals of time)
of the process, thereby causing extra load on the CPU. This process will spin until the latch is available. A
dba has to monitor the latches for contention and make sure that CPU cycles are not being burnt on process
spinning.
105. Does ROLLUP work with multiple columns? The ROLLUP feature can in fact be applied to multiple
columns. The result is multiple levels of rollup, as illustrated here: select deptno, job, count(*),
grouping(deptno), grouping(job) from emp group by rollup(deptno, job);
DEPTNO JOB COUNT(*) GROUPING(DEPTNO) GROUPING(JOB) ---- ---- ---- ---- ---- 10 CLERK 1 0 0 10
MANAGER 1 0 0 10 PRESIDENT 1 0 0 10 3 0 1 20 ANALYST 2 0 0 20 CLERK 2 0 0 20 MANAGER 1 0 0
20 5 0 1 30 CLERK 1 0 0 30 MANAGER 1 0 0 30 SALESMAN 4 0 0 30 6 0 1 14 1 1 As shown in this
example, we're able to count the employees by 1) department and job; 2) department; and 3) grand total.
106. What is an inline view? A subquery in the from clause of your main query.
107. Give an example of an inline view and Top-N Query.
SELECT ename, job, sal, rownum FROM (SELECT ename, job, sal FROM emp ORDER BY sal) WHERE
rownum <= 3;
108. What SQL*Plus command is useful for determining whether the "N rows selected" message will
appear? Feedback
109. What SQL*Plus keyword is used for defining formats for how SQL*Plus displays column information?
Set
110. This phrase describes a query that feeds one row of results to a parent query for the purpose of
selection when the exact where clause criteria is not known?
Single-row subquery.
111. Use of what command requires that you first run the plustrce.sql script?
Autotrace
112. The database for an international athletic competition consists of one table, ATHLETES, containing
contestant name, age, and represented country. To determine the youngest athlete representing each
country, how do you write the code? scott@PO816>SELECT name, country, age FROM athletes WHERE
(country, age ) IN ( SELECT country, min(age) FROM athletes GROUP BY country);
113. What is a single-row subquery?
The main query expects the subquery to return only one value.
114. What is an inline view?
A subquery in a from clause used for defining an intermediate result set to query from.
115. What does AUTOTRACE do?
Allows us to see the execution plan of the queries we've executed and the resources they used, without
having to use the EXPLAIN PLAN command.
116. What does SQL_TRACE do?
Enables logging of all application SQL, performance stats and query plan used.
117. What does TKPROF do? Formats the raw trace files into a readable report.
118. What are the two main index types that Oracle uses? B*Tree and Bitmap
119. When are Bitmap indexes appropriate?
Page 74 of 262
In situations of low cardinality data, i.e. data with few distinct values.
120. What is a top-n query?
select * from ( select ename from emp order by sal ) where rownum <= 3;
In general it refers to getting the top-n rows from a result set.
121. What is PostgreSQL?
PostgreSQL is a sophisticated Object-Relational DBMS, supporting almost all SQL constructs, including
subselects, transactions, and user-defined types and functions. It is the most advanced open-source
database available anywhere. Commercial Support is also available.
122. What are the three main reasons for partitioning a database?
1. To increase availability (derived from the fact that partitions are independent entities).
2. To ease administration burdens (derived from the fact that performing operations on small objects is
inherently easier, faster, and less resource intensive than performing the same operation on a large object).
3. To enhance DML and query performance (potential to perform parallel DML).
123. What are the two types of cursors?
Implicit (Oracle's) and explicit (yours).
124. Does the order of stored procedures in a package matter?
It does if one procedure calls another; if that happens, the calling procedure must be the earlier of the two.
125. How does 9i compare to 8i?
Oracle8 provides the same flexibility with table indexes as it does with table partitions. To take advantage of
this index flexibility, you go through the same steps used in table partitioning. Again, you do not have to
modify existing applications and business processes.
Q22: What is the advantage of using Packages over using procedures and funtions?
Ans: A Stored packages allow you to encapsulate, or group, related stored procedures, variables, datatypes,
etc. in a single named, stored unit in the database. This provides for better organization during the
development process.
Encapsulation of procedural constructs in a package also makes privilege management easier. Granting the
privilege to use a package makes all constructs of the package accessible to the grantee.
Using packages rather than stand–alone stored procedures results in the following improvements:
The entire package is loaded into memory when a procedure within the package is called for the first time.
This load is completed in one operation, as opposed to the separate loads required for standalone
procedures. Therefore, when calls to related packaged procedures occur, no disk I/O is necessary to
execute the compiled code already in memory.
Page 75 of 262
A package body can be replaced and recompiled without affecting the specification. As a result, objects
that reference a package’s constructs (always via the specification) never need to be recompiled unless the
package specification is also replaced. By using packages, unnecessary recompilations can be minimized,
resulting in less impact on overall database performance.
8 number,date
14 which function enables you to find out the time in a time zone by simply passing the date and time
of first zone
and specifying the second zone,write the syntax of that function?
Ans.NEW_TIME(input_date_and-time,time_zone1,time_zone2)
15 what is a relation
Ans. the no of rows in a table are tuples and the set of value the attribute may have is called domain
17 what is vsam
Ans. virtual storage access method
28 ceil(10.6),round(10.6),trunc(10.6),floor(10.6) is a)11,10,10,10
b)11,11,11,10
c)11,11,10,10
answer is (c)
30 Name the column which behave like a table column but is not actullay stored in the table we can
not insert ,delete,update their values
Ans. Pseudocolumns
32 what is optimization
Ans. excellent execution path for sql statements
37 which one is block level trigger I.e not true for form level?
1)when-clear-block
2)when-new-block-instance
3) 1,2 both
4) none
answer is 4.
39 Name the triggers which fire automatically when we create the master detail block
Ans. on-clear-details
on-check-delete-master
on-populate-details
Page 78 of 262
44 which is true
alter table clause perform following task
a)change the name of table
b)change the name of column
c)drop a column
d)decrease the size of column
e) none
answer is (e)
45 write the syntax for copying the data from one database to another database
Ans. COPY [FROM username [/password] [@database_specification]|
TO username [/password] [@database_specification]]
APPEND|CREATE|INSERT|REPLACE} destination_table
[(column, column, column, ...)] USING query
Q60 : Are there any facilities to restart a report that was stopped in the middle of processing for whatever
reason?
Ans. No
Q61 :Is there anyway to programmatically disable the PRINT button in the Previewer ?
Ans. Currently this is an enhancement request and is being considered for a future release of the product.
Q62 : Is there any way in Reports 2.0 or 2.5 to trap all errors in order to display your own error message,
similar to the ON-ERROR and ON-MESSAGE triggers in Forms ?
Ans. no
Q63 : Is pl/sql support data defination languge
Ans. No,but by using sql_dbms package it support the ddl.
Q64 :What is name of SQL System Control command
Ans. Alter system
Q65:lock table is which type of command
a)DDL
b)DML
c)sql transection control command
Ans. b)DML
answer is 2017
84 DATATYPE OF GLOBALS
Ans.char
Q86 :HOW MANY CODD'S RULE ARE SATISFIED BY ORACLE7.x partially or fully
Ans.all the codd's rule are satsfied by oracle 7.x
Q87 :WHAT IS THE DIFF BETWEEN PRIMARY KEY AND CANDIDATE KEY
Ans. there may be two or more attributes that uniquely identify an instance of an entity set.these attributes
or combination of attributes are called candidate key.in such a case we must decide which of the candidate
key will be used as primary key.the remaning keys would be considered as alternate key
Q88 :WHAT IS THE DIFF BETWEEN RADIO BUTTON AND PUSH BUTTON
Ans. a radio button created with radio group, but no group req for creating push button
Q89 :What do you understand by metadata?
Ans. Description of database is called meta data
Ans. Database triggers are defined on a table and stored in the associated database and executed as a
result of an insert, update,delete statement being issued against a table.sql*form triggers are fired only when
a specific trigger point is executed witin a specific application
Q95 :What are control items item
Ans. Which have no base table
Q96 :Write diff type of library file format
Ans. .pll,.plx,.pld
Q97 :When creating master detail form which of the master delete property set by default
Ans. non-isolated
Q98 :What is the default value set for sys date in a form
Ans. $$date$$
Q102 :Oracle report provides several system parameter two of which are included in the run time parameter
formby default what are that
Ans. Destination name,destination type
Q105 :At least how many content canvas view you define for each window in your application.
Ans. At least one
Q109:What exactly does 'Query Hits' and 'Query Options' mean in the context of a block ?
Ans. Set_Block_Property(.., QUERY_HITS) lets your ON-COUNT transactional trigger tell Forms how
many records the query out the message :"FRM-xxxxx: Query will retrieve nnn record(s)."Getting this
property via Get_Block_Property(.., QUERY_HITS) simply returns the number of records that have been
retrieved by the query.Get_Block_Property(.., QUERY_OPTIONS) lets your transactional trigger know
whether it's supposed to be doing a normal query, a COUNT(*) type query, or a lock record query.
Q110 :What is the difference between the block properties of ARRAY SIZE and RECORDS BUFFERED ?
Ans. ARRAY SIZE is the number of records that get fetched each time forms goes to the database.
The RECORDS BUFFERED specifies the minimum number of records that should be placed in memory
when records are fetched from the database. Even if you specify a low value of 3, the minimum per form is
slightly over 300.As more records are brought back from the database (eg records 303-306) they get moved
between memory and the file buffer as the user scrolls down.
Q111 : Write diff datatypes for a parameter in a form?
Ans.Parameters are NUMBER, CHAR, or DATE
Q112 : What is the diff between Pre-Query vs. Pre-Select
Ans. PRE-QUERY fires just before Forms begins to prepare the SQL statement that will be required to
query the appropriate records from the database in response to the query criteria that have been entered
into the example record.It is the designers last chance to "deposit" query criteria into the items in the block
as if they had been entered into the example record by the operator.
PRE-SELECT fires after the PRE-QUERY trigger has fired,and just before the actual, physical construction
of the SELECT statement begins. It would typically be used in conjunction with an ON-SELECT trigger in
which the designer would be supplanting the normal construction of the SELECT statement with a user exit
of his own to construct and prepare the SELECT statement for execution (perhaps against a foreign
datasource).
Q113 : To store images in the database, you need to read them from the file system in one of the supported
standard file formats ,name some of the files?
Ans. JFIF,PCX,BMP,TIFF
Q114 :How can I determine which user interface I am using at runtime
Ans. Issue the builtin Get_Application_Property (USER_INTERFACE).'PICT'
Q115 : Will the following query use an index ,given rule based optimization :
select distinct city from emp where city not in('new york','boston','dallas')
a. Yes
b. No
Ans. b
Q116 : What will the outcome of following command?
REVOKE CONNECT FROM MARY
a. mary's current session will be disconnected
b.mary's account will be dropped
c.maty will no longer be able to use the connect privilege
d.mary will no longer be able to enable the connect role.
category: security
And : d.
Q117 : Which program is used to verify sql*net v2 connectivity from a window connectivity
a. tnsname b.listener
b.listener c.orasrv
c.orasrv d.tnsping
d.tnsping
answer is d.
Q118 : Which of the following is not a lockmode option for the lock table command a.share update
a.share update
b.share row level exclusive
c row share
d.update
Ans: d.
Page 83 of 262
Q119 :When you create a new table space ,do the control file increase in size
a.yes,
b. no
Ans b.
Q120 : An SCN is a.SOURCE CODE NO
b.system contril number
c.system change number
d.session commit node
Ans : C.
Q121 : What is the outcoming of following command :
a.all succesfull connection to the databases will be recorded
audit session b.all unsucessfull connection to the data base are recorded
c.all successfull and unsuccesfull connection are recorded
d.the command will return an error
Ans: a.D.B.A.-objects
Q123 : Place the database creation steps listed below in their proper chronological order:
1.cretae database
2.create tablespace roll_segs....
3.create rollback segments R_1 table space roll_segs
4.create rollback segments r1 tablespace system
5.alter rollback segment R_1 online
Ans: a.
Q125 :A large table has all of its records are deleted, and the deletion is commited .to verify that there is no
record
a.Table was fragmentd into multiple extents.,you perform the following query
b.the table have more index on it select count(*) from employee;
c.The table has not analyzed since its records had been deleted.But it takes long time to give the result
d.The tables highwatermark had not been reset.
Ans.d.
Q126 :WHICH OF THE FOLLOWING WOULD CAUSE A SHUTDOWN IMMEDIATE TO FAIL?
a).a transacton that has just started.
b).a user process that is not connected.
c).a transection that is in the process of rolling back
d).a deadlock between two process.
Ans :d.
Q127 :Which of the following can you not change after a database has
beencreated
a.) shared pool size
b.)the default no of listener
c.)the no. of control file.
d.)the database block size
Ans. d.
Page 84 of 262
answer is b.
Q130 : Which of the following constraints ,when applied to a table,will automatically create an index?
a.foreign key
b.check
c.unique
d.not null
Ans: c.
Ans: a.
Ans: a.
Q133 :DUAL is a tiny table provide with how many rows and column in it
Ans. 1,1
Q134 :SELECT ROUND(99.308,1) FROM DUAL;
Ans. 99.3
Q135 :SELECT ROUND(99.308) FROM DUAL;
Ans. 99
Q136 :select round(99.308,-1) FROM DUAL;
Ans. 100
Q137 :WHAT IS THE DIFF BETWEEN APPEND AND INSERT IN CASE OF SQLLODER?
Ans : Append is done if the table have record,but in case of insert the table must be empty.
Q138 :HOW MANY DATATYPES CAN BE LOADED USING SQL*LOADER
Ans.14
Q139 :$CHMOD 753 MEMO1,EXPLAIN THIS
Ans. owner has rwe rights group has re others has we
Q140 :To change the ownership which of the commond is used in unix
Ans. chown user2 temp
then result of
P INTERSECTION Q IS
a.
id name
101 jones
103 smith
104 evan
106 bayron
107 drew
112 smith
c
id name
106 bayron
ans b
Q152 :CEIL(4*3*(12-1)+12*9+7*(55-12*4)/11)
Ans. 245
Q153 :What is DDBMS ?
Ans. Distributed data base management system
UPDATE emp 2
SET sal = sal*1.1
WHERE empno = 2000;
WHAT IS THE RESULT OF TIME POINT2
Ans : deadlock
Q161 :WHAT IS BOM IN AN ERP
Ans. Bill of material
Q162 :WHAT IS THE ORDER OF FIRING THE TRIGGERS IN A FORM
Ans. form----->block------->item
Ans: b.
Q171 :Reload is the option for which of the following utilities
a.sqlload
b.lsnrctl
c.import
d.sqldba
Ans: b.
Q172 :Which of the following privileges can not be granted to a role
a.create session
b.unlimited tablespace
Page 87 of 262
Ans :b
Q173 :Which of the background process periodically coalesces free space in
the table
a.smon
b.pmon
c.imon
d.fmon
Ans :a .
Q174 :Which of the foloowing is not apart of create index statment?
a.pctfree
b.pctused
c.initrans
d.freelist
Ans: b.
Q175 : An index corrosponds to a table from which many record are being
deleted .to reclaim or reuse
a.alter the index to decrese pctused to 20 space used by the deleted index rows,which action would be
best?
b.alter the index to increase pctused
c.alter the index to increse next
d.drop and recreate the index
Ans:d.
Q176 :What is virtual table?
Ans. A view is defined using a query, and can thus be thought of as a "stored query" or a "virtual table."
Views can be used in most places where a table can be used.
Q177 : What is sys.
Ans. All base tables and user accessible views of the data dictionary are owned by the ORACLE user SYS.
Therefore,no ORACLE user should ever alter any object contained in the SYS schema and the security
administrator should keep strict
control of this central account
Q178 :What is the diff between V$ AND V_$
Ans. The dynamic performance tables are owned by SYS and their name is all begin with V_$. Views are
created on these tables, and then synonyms are created for the views. The synonym names begin with V$.
Q179 :WHAT IS DATABASE AND DATABASE MANAGEMENT SYSTEM
Ans. The integrated collection of related files is called database,
dbms is the software system that allow access to data contained in a database.
Q180 :DEFINE TWO DISTICT LEVEL OF DATA INDEPENDENCY
Ans. logical data independency and physical data independency
Q181 :NAMED DIFF TYPES OF RELATIONSHIPS IN THE SETS/
Ans. 1:1 ,1:m ,m:n
Q182 :What are weak entity?
Ans. ENTITES WHICH ARE THE PART OF AN ENTITES e,.g employee in atble is an entity but dependents
of an emp are weak entity
Q183 :Name two phase in two phase commit?
Ans. prepare phase
Commit phase
Q184 :The two-phase commit mechanism is only used if a transaction contains a.DML
B.DDL
C.remote procedure call that references a remote object using its global object name which of the above is
false?
Ans: b.
Q185 :What is pseudo code?
Ans. pseudo code (P code)The PL/SQL compiler generates the pseudocode, or P code,based on the or p
code ,based on the parsed code. The PL/SQL engine executes this when the procedure or package is
invoked.
Q186 :What is RR FORMAT
Page 88 of 262
Ans. The RR date format element is similar to the YY date format element,but it provides additional flexibility
for storing date values in other centuries. The RR date format element allows you to store twenty-first
century dates in the twentieth century by specifying only the last two digits of the year. It will also allow you
to store twentieth century dates in the twenty-first century in the same way if necessary.
Q187 :IS THERE ANY DIFF BETWEEN DATABASE TABLE AND PL/SQL TABLE?'
Ans. PL/SQL tables can have one column and a primary key, neither of which can be named.The column
can belong to any scalar type, but the primary key must belong to type BINARY_INTEGER.
Q188 :WHAT ARE Lexical Units
Ans. A line of PL/SQL text contains groups of characters known as lexical units,
Q189 :NAME DIFF SQL COMMANDS?
Ans.
* Data Definition Language commands
* Data Manipulation Language commands
* Transaction Control commands
* Session Control commands
* System Control commands
Ans. Bind references are used to replace a single value in SQL or PL/SQL. Specifically, bind references
may be used to replace expressions in SELECT, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT
BY, and START WITH clauses of queries. Binds may not be referenced in the FROM clause.
Q55 :What are the name of block which have no base table ?
Ans. Control block
Q60 : Are there any facilities to restart a report that was stopped in the middle of processing for whatever
reason?
Ans. No
Q61 :Is there anyway to programmatically disable the PRINT button in the Previewer ?
Ans. Currently this is an enhancement request and is being considered for a future release of the product.
Q62 : Is there any way in Reports 2.0 or 2.5 to trap all errors in order to display your own error message,
similar to the ON-ERROR and ON-MESSAGE triggers in Forms ?
Ans. no
Q63 : Is pl/sql support data defination languge
Ans. No,but by using sql_dbms package it support the ddl.
Q64 :What is name of SQL System Control command
Ans. Alter system
Q65:lock table is which type of command
a)DDL
b)DML
c)sql transection control command
Ans. b)DML
84 DATATYPE OF GLOBALS
Ans.char
Q86 :HOW MANY CODD'S RULE ARE SATISFIED BY ORACLE7.x partially or fully
Ans.all the codd's rule are satsfied by oracle 7.x
Q87 :WHAT IS THE DIFF BETWEEN PRIMARY KEY AND CANDIDATE KEY
Ans. there may be two or more attributes that uniquely identify an instance of an entity set.these attributes
or combination of attributes are called candidate key.in such a case we must decide which of the candidate
key will be used as primary key.the remaning keys would be considered as alternate key
Q88 :WHAT IS THE DIFF BETWEEN RADIO BUTTON AND PUSH BUTTON
Ans. a radio button created with radio group, but no group req for creating push button
Q89 :What do you understand by metadata?
Ans. Description of database is called meta data
Ans. Oracle fires a row trigger once for each row that is affected by the triggering statement and meets the
optional trigger constraint defined in the WHEN clause.if you omit this clause, the trigger is a statement
trigger. Oracle fires a statement trigger only once when the triggering statement is issued if the optional
trigger constraint is met.
Q94 : Diff between database trigger and form trigger
Ans. Database triggers are defined on a table and stored in the associated database and executed as a
result of an insert, update,delete statement being issued against a table.sql*form triggers are fired only when
a specific trigger point is executed witin a specific application
Q95 :What are control items item
Ans. Which have no base table
Q96 :Write diff type of library file format
Ans. .pll,.plx,.pld
Q97 :When creating master detail form which of the master delete property set by default
Ans. non-isolated
Q98 :What is the default value set for sys date in a form
Ans. $$date$$
Q102 :Oracle report provides several system parameter two of which are included in the run time parameter
formby default what are that
Ans. Destination name,destination type
Q105 :At least how many content canvas view you define for each window in your application.
Ans. At least one
Q109:What exactly does 'Query Hits' and 'Query Options' mean in the context of a block ?
Ans. Set_Block_Property(.., QUERY_HITS) lets your ON-COUNT transactional trigger tell Forms how
many records the query out the message :"FRM-xxxxx: Query will retrieve nnn record(s)."Getting this
property via Get_Block_Property(.., QUERY_HITS) simply returns the number of records that have been
retrieved by the query.Get_Block_Property(.., QUERY_OPTIONS) lets your transactional trigger know
whether it's supposed to be doing a normal query, a COUNT(*) type query, or a lock record query.
Q110 :What is the difference between the block properties of ARRAY SIZE and RECORDS BUFFERED ?
Ans. ARRAY SIZE is the number of records that get fetched each time forms goes to the database.
The RECORDS BUFFERED specifies the minimum number of records that should be placed in memory
when records are fetched from the database. Even if you specify a low value of 3, the minimum per form is
slightly over 300.As more records are brought back from the database (eg records 303-306) they get moved
between memory and the file buffer as the user scrolls down.
Q111 : Write diff datatypes for a parameter in a form?
Ans.Parameters are NUMBER, CHAR, or DATE
Q112 : What is the diff between Pre-Query vs. Pre-Select
Ans. PRE-QUERY fires just before Forms begins to prepare the SQL statement that will be required to
query the appropriate records from the database in response to the query criteria that have been entered
into the example record.It is the designers last chance to "deposit" query criteria into the items in the block
as if they had been entered into the example record by the operator.
PRE-SELECT fires after the PRE-QUERY trigger has fired,and just before the actual, physical construction
of the SELECT statement begins. It would typically be used in conjunction with an ON-SELECT trigger in
which the designer would be supplanting the normal construction of the SELECT statement with a user exit
of his own to construct and prepare the SELECT statement for execution (perhaps against a foreign
datasource).
Q113 : To store images in the database, you need to read them from the file system in one of the supported
standard file formats ,name some of the files?
Ans. JFIF,PCX,BMP,TIFF
Q114 :How can I determine which user interface I am using at runtime
Ans. Issue the builtin Get_Application_Property (USER_INTERFACE).'PICT'
Q115 : Will the following query use an index ,given rule based optimization :
select distinct city from emp where city not in('new york','boston','dallas')
a. Yes
b. No
Ans. b
Q116 : What will the outcome of following command?
REVOKE CONNECT FROM MARY
a. mary's current session will be disconnected
b.mary's account will be dropped
c.maty will no longer be able to use the connect privilege
d.mary will no longer be able to enable the connect role.
category: security
And : d.
Q117 : Which program is used to verify sql*net v2 connectivity from a window connectivity
a. tnsname b.listener
b.listener c.orasrv
c.orasrv d.tnsping
d.tnsping
answer is d.
Q118 : Which of the following is not a lockmode option for the lock table command a.share update
a.share update
Page 93 of 262
Q119 :When you create a new table space ,do the control file increase in size
a.yes,
b. no
Ans b.
Q120 : An SCN is a.SOURCE CODE NO
b.system contril number
c.system change number
d.session commit node
Ans : C.
Q121 : What is the outcoming of following command :
a.all succesfull connection to the databases will be recorded
audit session b.all unsucessfull connection to the data base are recorded
c.all successfull and unsuccesfull connection are recorded
d.the command will return an error
Ans: a.D.B.A.-objects
Q123 : Place the database creation steps listed below in their proper chronological order:
1.cretae database
2.create tablespace roll_segs....
3.create rollback segments R_1 table space roll_segs
4.create rollback segments r1 tablespace system
5.alter rollback segment R_1 online
Ans: a.
Q125 :A large table has all of its records are deleted, and the deletion is commited .to verify that there is no
record
a.Table was fragmentd into multiple extents.,you perform the following query
b.the table have more index on it select count(*) from employee;
c.The table has not analyzed since its records had been deleted.But it takes long time to give the result
d.The tables highwatermark had not been reset.
Ans.d.
Q126 :WHICH OF THE FOLLOWING WOULD CASUSE A SHUTDOWN IMMEDIATE TO FAIL?
a).a transacton that has just started.
b).a user process that is not connected.
c).a transection that is in the process of rolling back
d).a deadlock between two process.
Ans :d.
Q127 :Which of the following can you not change after a database has
beencreated
a.) shared pool size
b.)the default no of listener
Page 94 of 262
Ans. d.
answer is b.
Q130 : Which of the following constraints ,when applied to a table,will automatically create an index?
a.foreign key
b.check
c.unique
d.not null
Ans: c.
Ans: a.
Ans: a.
Q133 :DUAL is a tiny table provide with how many rows and column in it
Ans. 1,1
Q134 :SELECT ROUND(99.308,1) FROM DUAL;
Ans. 99.3
Q135 :SELECT ROUND(99.308) FROM DUAL;
Ans. 99
Q136 :select round(99.308,-1) FROM DUAL;
Ans. 100
Q137 :WHAT IS THE DIFF BETWEEN APPEND AND INSERT IN CASE OF SQLLODER?
Ans : Append is done if the table have record,but in case of insert the table must be empty.
Q138 :HOW MANY DATATYPES CAN BE LOADED USING SQL*LOADER
Ans.14
Q139 :$CHMOD 753 MEMO1,EXPLAIN THIS
Ans. owner has rwe rights group has re others has we
Q140 :To change the ownership which of the commond is used in unix
Ans. chown user2 temp
Ans. ls -a
then result of
P INTERSECTION Q IS
a.
id name
101 jones
103 smith
104 evan
106 bayron
107 drew
112 smith
c
id name
106 bayron
ans b
Q152 :CEIL(4*3*(12-1)+12*9+7*(55-12*4)/11)
Ans. 245
Q153: What is DDBMS ?
Ans. Distributed database management system
Ans. The conceptual schema can be changed withot affecting the existing external schema.
Q155: WHAT IS SUPER KEY?
Ans. IF WE ADD AN ADDITIONAL ATTRIBUTE TO A PRIMARY KEY THEN THE RESULTING
COMBINATION IS AGAIN A PRIMARY KEY.SUCH A KEY IS CALLED SUPER KEY.
Q156: WHAT IS UWA?
Ans. IT IS USER WORK AREA
Q157 :WHAT ARE VIRTUAL FIELD
Ans. UNLIKE A REAL FIELD A VIRTUAL FIELD CANNOT MODIFIED BY USER.
e.g age: depend upon date of birth and todays date.
UPDATE emp 2
SET sal = sal*1.1
WHERE empno = 2000;
WHAT IS THE RESULT OF TIME POINT2
Ans : deadlock
Q161 :WHAT IS BOM IN AN ERP
Ans. Bill of material
Q162 :WHAT IS THE ORDER OF FIRING THE TRIGGERS IN A FORM
Ans. form----->block------->item
Ans: b.
Q171 :Reload is the option for which of the following utilities
a.sqlload
b.lsnrctl
c.import
d.sqldba
Page 97 of 262
Ans: b.
Q172 :Which of the following privileges can not be granted to a role
a.create session
b.unlimited tablespace
c.insert any table
d.analyze any
Ans :b
Q173 :Which of the background process periodically coalesces free space in
the table
a.smon
b.pmon
c.imon
d.fmon
Ans :a .
Q174 :Which of the foloowing is not apart of create index statment?
a.pctfree
b.pctused
c.initrans
d.freelist
Ans: b.
Q175 : An index corresponds to a table from which many record are being deleted .to reclaim or reuse
a. Alter the index to decrease pctused to 20 space used by the deleted index rows,which action
would be best?
b. Alter the index to increase pctused
c. Alter the index to increase next
d. Drop and recreate the index
Ans:d.
Q176 :What is virtual table?
Ans. A view is defined using a query, and can thus be thought of as a "stored query" or a "virtual table."
Views can be used in most places where a table can be used.
Q177 : What is sys.
Ans. All base tables and user accessible views of the data dictionary are owned by the ORACLE user SYS.
Therefore,no ORACLE user should ever alter any object contained in the SYS schema and the security
administrator should keep strict
control of this central account
Q178 :What is the diff between V$ AND V_$
Ans. The dynamic performance tables are owned by SYS and their name is all begin with V_$. Views are
created on these tables, and then synonyms are created for the views. The synonym names begin with V$.
Q179 :WHAT IS DATABASE AND DATABASE MANAGEMENT SYSTEM
Ans. The integrated collection of related files is called database,
dbms is the software system that allow access to data contained in a database.
Q180 :DEFINE TWO DISTICT LEVEL OF DATA INDEPENDENCY
Ans. logical data independency and physical data independency
Q181 :NAMED DIFF TYPES OF RELATIONSHIPS IN THE SETS/
Ans. 1:1 ,1:m ,m:n
Q182 :What are weak entity?
Ans. ENTITES WHICH ARE THE PART OF AN ENTITES e,.g employee in atble is an entity but dependents
of an emp are weak entity
Q183 :Name two phase in two phase commit?
Ans. prepare phase
Commit phase
Q184 :The two-phase commit mechanism is only used if a transaction contains a.DML
B.DDL
C.remote procedure call that references a remote object using its global object name which of the above is
false?
Ans: b.
Q185 :What is pseudo code?
Page 98 of 262
Ans. pseudo code (P code)The PL/SQL compiler generates the pseudocode, or P code,based on the or p
code ,based on the parsed code. The PL/SQL engine executes this when the procedure or package is
invoked.
Q186 :What is RR FORMAT
Ans. The RR date format element is similar to the YY date format element,but it provides additional flexibility
for storing date values in other centuries. The RR date format element allows you to store twenty-first
century dates in the twentieth century by specifying only the last two digits of the year. It will also allow you
to store twentieth century dates in the twenty-first century in the same way if necessary.
Q187 :IS THERE ANY DIFF BETWEEN DATABASE TABLE AND PL/SQL TABLE?'
Ans. PL/SQL tables can have one column and a primary key, neither of which can be named.The column
can belong to any scalar type, but the primary key must belong to type BINARY_INTEGER.
Q188 :WHAT ARE Lexical Units
Ans. A line of PL/SQL text contains groups of characters known as lexical units,
Q189: NAME DIFF SQL COMMANDS?
Ans.
* Data Definition Language commands
* Data Manipulation Language commands
* Transaction Control commands
* Session Control commands
* System Control commands
A packaged business software system that lets a company automate and integrate the majority of its
business processes; share common data and practices across the enterprise; [and] produce and
access information in a real-time environment.
2) Tell me some thing about SQL-LOADER.
Sql * loader is a bulk loader utility used for moving data from external files into the oracle database.
Sql * loader supports various load formats, selective loading, and multi-tables loads.
1) conventional
--The conventional path loader essentially loads the data by using standard ‘insert’ statement.
2) direct
-- the direct path loader (direct = true) by possess of logic involved with that, and loads directly in
to the oracle data files.
EX:-
My data.csv file
1001, “scott tiger”,1000,40
1002,”gvreddy”,2345,50
Load data
Infile ‘c:\data\mydata.csv’
Into table emp
Fields terminated by “,” optionally enclosed by ‘”’
(empno, empname,sal,deptno)
>sqlldr scott/tiger@vis
control=loader.ctl log= gvlog.log bad=gvbad.bad discard=gvdis.dsc .
3) how do u dump data from pl/sql block to flat files?
Using utl_file package, we can dump data from pl/sql block to flat file.
PRE-REQUIREMENTS for UTL_FILE is specify the accessible directories for the UTL_FILE function in
the initialization file (INIT.ORA) Using the UTL_FILE_DIR parameters.
Ex: UTL_FILE_DIR = <Directory name>
EX:-
--remember to update INITSID.ORA,
--utl_file_dir = ‘c:\oradata’
Declare
Fp utl_file.file_type;
Begin
Fp := utl_file.fopen(c:\oradata’,tab1.txt’,’w’);
Utl_file.putf(fp,’%s %s \n ‘text field’, 55);
Utl_file.fclose(fp);
End;
4) What is SET-OF-BOOKS?
Collection of Chat of Accounts and Currency and Calendars is called SOB
5) What is the interface?
Interface Table is a table, which is used as medium for transfer of data between two systems.
6) What is invoice?
Send you a request for payment
Page 100 of 262
Outbound Interface:
For outbound interfaces, where these products are the source, database views are provided and
the destination application should provide the validation, processing, and maintenance programs
8) Tell me what r the Base tables in the AR?
hz_parties (party_id) (store info about org, groups and people)
HZ_PARTIES stores information about parties such as organizations, people, and groups,
including the identifying address information for the party.
hz_cust_accounts (cust_account_id)
HZ_CUST_ACCOUNTS stores information about customer relationships. If a party becomes a
customer, information about the customer account is stored in this table. You can establish multiplecustomer
relationships with a single party, so each party can have multiple customer account records in this table.
hz_cust_acct_sites_all (cust_acct_site_id)
HZ_CUST_ACCT_SITES_ALL stores information about customer sites.One customer account
can have multiple sites. The address is maintained in HZ_LOCATIONS.
hz_cust_site_uses_all (site_use_id)
HZ_CUST_SITE_USES_ALL stores information about site uses or business purposes. A single
customer site can have multiple site uses, such as bill to or ship to, and each site use is stored as a record
in this table.
hz_party_sites (party_site_id)
HZ_PARTY_SITES stores information about the relationship between Parties and Locations. The
same party can have multiple party sites.Physical addresses are stored in HZ_LOCATIONS.
hz_locations (location_id)
HZ_LOCATIONS stores information about physical locations.
hz_Person_Profiles (person_profile_id)
HZ_PERSON_PROFILES stores detail information about people.
hz_Organization_Profiles (organization_profile_id)
HZ_ORGANIZATION_PROFILES stores credit rating, financial statistics, socioeconomic and
corporate linkage information for business sites. The primary key for this table is
ORGANIZATION_PROFILE_ID.
ADDRESS1 through 4
Enter the address for your customer in these four columns. You can enter up to four lines of
an address.
Page 101 of 262
Validation:
If you enter a value in ORIG_SYSTEM_ADDRESS_REF, you must enter a value in ADDRESS1. For
multiple rows with the same address reference, insert values in address 1–4.
Destination: HZ_LOCATIONS.ADDRESS1,
HZ_LOCATIONS.ADDRESS2,
HZ_LOCATIONS.ADDRESS3,
HZ_LOCATIONS.ADDRESS4
2) Ra_customer_profile_int_all
A customer level profile must exist in A_CUSTOMER_PROFILES_INTERFACE for new customers and each
bill–to business purpose.
3) Ra_contact_phones_int_all
This table stores telephone numbers for customers, addresses and contacts as well as contacts for
customers and addresses.
4) Ra_customer_banks_int_all
This table stores bank information for a customer or for a specific Bill–To address, you must enter a bank
account for this customer,
5) Ra_cust_paymethod_int_all
To import payment methods for customers and bill–to business purposes,
6) last_updated_date
7)created_by
8) creation_date.
b) Ra_customer_profile_int_all
1) customer_profile_class_name
c) Ra_contact_phones_int_all
1)orig_system_telephone_ref
2)telephone
3) telephone_type
d) Ra_customer_banks_int_all
Page 102 of 262
1) bank_a/c_name
2)bank_a/c_no
3)bank_a/c_currency_code
e) Ra_cust_paymethod_int_all
1) payment_method_name
Following tables
RA_SITE_USES_ALL
RA_CUSTOMER_RELATIONSHIPS_ALL
RA_CUST_RECEIPT_METHODS
AP_BANK_BRANCHES
AP_BANK_ACCOUNTS_ALL
AP_BANK_ACCOUNT_USES_ALL
2. How to send additional customer and address information through customer interafce
RA_CUSTOMERS_INTERFACE_ALL.customer_attribute1 to 15
RA_CUSTOMERS_INTERFACE_ALL.address_attribute1 to 15
And so on.
5. What should be the batch size (number of customer records) general guidelines for optimal performance
Page 103 of 262
About 10,000 records per bacth is ideal, it is suggested to keep the batch
size small.
6. Why does customer interface error out if there is mismatch in address information?
It validates the address being inserted or updated with respect to the tax
this new address. The RA_CUSTOMERS_INTERFACE record is then updated with the
7. How do you send records at customer level profile and address/site level profile?
11. Customer Interface process can be used for updating the customer information How does the UPDATE
work?
Current functionality of Customer Interface is to update all the data. You cannot run Customer Interface to
update only changed data. (Refer Bug: 879121 for the intended functinality)
12. What are some of the important fields that Customer Interface does not load?
SIC_CODE
GSA_INDICATOR
FOB_POINT
Page 104 of 262
SALES_CHANNEL_CODE
FREIGHT_TERM
WAREHOUSE_ID
PRICE LIST
SHIP_PARTIAL
PAYMENT_TERM_ID in RA_SITE_USES.PAYMENT_TERM_ID
13. New TCA/Customer Model, how to load customer as PERSON or ORGANIZATION through Customer
Interface?
BANK_A/C_NUM
BANK_NAME
BANK_BRANCH_NAME
Note : every interface table has two error msg
1) Error code.
2) Error msg.
15) How can u call a standard interface program from sql or pl/sql code?
FND_REQUEST.SUBMIT_REQUEST (‘PO’,’EXECUTABLE NAME’,,,,PARAMETERS)
16) API’s FOR CUSTOMER INTERFACE?
HZ_CUST_A/C_VZPUB.UPDATE_CUST_A/C
HZ_CUST_A/C_VZPUB.CREATE_CUST_A/C
FND_PROFILES
FND_APPLICATIONS
FND_GLOBAL
FND-FILE
FND_CONCSUB(can submit conc program in host invironment)
17) Tell me some API?
FND_FILE.PUTLINE(FND_FILE.LOG)
FND_FILE.PUTLINE(FND_FILE.OUTPUT)
Is the Program exits, delete conc program and its executables.
IF FND_PROGRAM.PROGRAM_EXITS(‘EMP’,APPLICATION_NAME_IN) THEN
FND_PROGRAM.DELETE_PROGRAM(‘EMP’,APPLICATION_NAME_IN)
FND_PROGRAM.DELETE_EXECUTABLE(‘EMP’,APPLICATION_NAME_IN)
END;
18) What are profile options?
Is the Functional and Technical behavior of Oracle Applications Package.
EX: - I want to assign the user3 responsibility to p4 printer then
System Administrator Profile System
(FND_PROFILE_OPTIONS)
19) Oracle E-Business suite?
Oracle apps + analytical components software.
(Oracle discover)
(Oracle sales analyzer)
(Oracle financial analyzer)
(Oracle marketing analyzer)
24) What is multi org?
“Legal entity has more than one operating unit is called as multi org”
a) Business group --- Human resources information is secured by
Business group
b) Legal entity. --- inter-company and fiscal/tax reporting.
Security responsibility operating unit.
Page 106 of 262
d) Registering in AOL.
Concurrent executable
Concurrent program then go to “PARAMETERS”
e) Go to Application validation set. then go to “EDIT INTO”
After entering the VALUE SETS (1) And TOKENS (2)
f) Go to Administrations
Sequrity responsibility Request
h) Add and assign a concurrent program to a request group
31) Tell me some report names and their table names in GL, AP, AR, and PO?
1) ra_customer_trx_all
customer_trx_id
trx_number (invoice no, debit memo no, credit memo no)
cust_trx_type_id
3) ar_payment_schdules_all
check_id
This table stores all transactions except adjustments and miscellaneous cash receipts.
Oracle Receivables updates this table when activity occurs against an invoice, debit memo, chargeback,
credit memo, on account credit, or receipt.
5) ra_batches_all
Batch_id
This table stores information about each receipt batch that you create in
Oracle Receivables. Each row includes information about a specific batch such as batch source, status,
batch type, control count, and control amount
6) ra_receivable_application_all
7) ra_adjustments_all
This table stores information about your invoice adjustments. Each row includes general information
about the adjustment you are making such as activity name, amount, accounting information, reason, and
type of adjustment. You need one row for each adjustment you are making to an invoice.
8) ra_cash_receiots_all
Cash_receipt_id
This table stores one record for each receipt that you enter. Oracle Receivables creates records
concurrently in the AR_CASH_RECEIPT_HISTORY_ALL, AR_PAYMENT_SCHEDULES_ALL, and
AR_RECEIVABLE_APPLICATIONS tables for invoice–related receipts.
1) ap_invoice_all
invoice_amount, base_amount, payment_status_flag(‘y’ –fully paid
‘n’—unpaid
‘p’ –partially paid)
2) ap_invoice_payments_all
invoice_id,
3) ap_invoice_distibutions_All
amount, base_amount, dist_code_combination_id, line_type_lookup_code
4) ap_payment_schdules
Page 109 of 262
payment_status_flag(“ ‘’’’’”)
5) ap_payment_dustributions_all
6) ap_checks_all
check_id,
AP_CHECKS_ALL stores information about payments issued to suppliers or refunds received
from suppliers. You need one row for each payment you issue to a supplier or refund received from a
supplier. Your Oracle Payables application uses this information to record payments you make to suppliers
or refunds you receive from suppliers.
7) ap_accounting_events_all
8) ap_bank_accounts_all
AP_BANK_ACCOUNTS_ALL contains information about your bank accounts. You need one
row for each bank account you define. Each bank account must be affiliated with one bank branch. When
you initiate an automatic payment batch, enter a manual check, or create a Quick payment, you can select a
bank account that you define in this table.
9) ap_bank_accounts_uses_all
AP_BANK_ACCOUNT_USES_ALL stores information for the internal and external bank accounts
you define in Oracle Payables and Oracle
Receivables applications.
1) po_vendors_all
2) po_vendors_sites_all
3) po_headers_all
po_header_id
4) po_lines_all
po_line_id
5) po_line_locations_All
6) po_distributions_all
po_distribution_id,
1) Gl_code_combinations
GL_CODE_COMBINATIONS stores valid account combinations for each Accounting Flexfield
structure within your Oracle General Ledger application. Associated with each account are certain codes
and flags, including whether the account is enabled, whether detail posting or detail budgeting is allowed,
and others.
2) Gl_je_batches.
GL_JE_BATCHES stores journal entry batches.
3) Gl_je_headers
GL_JE_HEADERS stores journal entries. There is a one–to–many relationship between journal entry
batches and journal entries. Each row in this table includes the associated batch ID, the journal entry name
and description, and other information about the journal entry. This table corresponds to the Journals
window of the Enter Journals form. STATUS is ’U’ for unposted, ’P’ for posted. Other statuses indicate that
an error condition was found. A complete list is below.
4) Gl_je_lines.
GL_JE_LINES stores the journal entry lines that you enter in the Enter Journals form. There is a
one–to–many relationship between journal entries and journal entry lines. Each row in this table stores the
associated journal entry header ID, the line number, the associated code combination ID, and the debits or
credits associated with the journal line. STATUS is ’U’ for unposted or ’P’ for posted
5) Gl_set of books
GL_SETS_OF_BOOKS stores information about the sets of books you define in your Oracle General
Ledger application. Each row includes the set of books name, description, functional currency, and other
information. This table corresponds to the Set of Books form.
6) Gl_periods
Page 110 of 262
GL_PERIODS stores information about the accounting periods you define using the Accounting
Calendar form. Each row includes the start date and end date of the period, the period type, the fiscal year,
the period number, and other information. There is a one–to–many relationship between a row in the
GL_PERIOD_SETS table and rows in this table.
Transaction types in AR
Credit memo transaction types
Invoice, debit memo, and charge back transaction types
Commitment transaction types
To provide expansion space on your form With the help Used for entering and displaying key information
of []. [] Represents For example Oracle General uses a key Flex field
descriptive Flex field. called Accounting Flex field to
uniquely identifies a general account.
FLEX FILED : DESCRIPTIVE : REGIGSTER
FLEX FILED : KEY : REGIGSTER
A bind variable is a variable that you declare in a host environment. Bind variables can be used to pass
run-time values, either number or character, into or out of one or more PL/SQL programs. The PL/SQL
programs use bind variables as they would use any other variable. You can reference variables declared
in the host or calling environment in PL/SQL statements, unless the statement is in a procedure, function,
or package. This includes host language variables declared in precompiler programs, screen fields in
Oracle Developer Forms applications, and iSQL*Plus bind variables.
Creating Bind Variables
To declare a bind variable in the iSQL*Plus environment, use the command VARIABLE. For example,
you declare a variable of type NUMBER and VARCHAR2 as follows:
VARIABLE return_code NUMBER
VARIABLE return_msg
CURSOR ATTRIBUTES
a) %is open: evaluates to true if the cursor is open.
b) %not found: evaluates to true if the most recent fetch does not return a row
c) %found: evaluates to true if the most recent fetch returns a row.
d) %row count: evaluates to the total number of rows returned to far.
2) Begin
Open emp_cursor;
Loop
Fetch when emp_cursor % rowcount >10 or
Emp_curor % not found;
Bdms_output_put_line(to_char(vno)||’ ‘|| vname);
End loop;
Close emp_cursor;
End;
Example:
1) Declare
Cursor emp_cursor is
Select empno,ename
From emp;
Begin
For emp_record in emp_cursor loop
Page 114 of 262
Dbms_output.putline(emp_record.empno);
Dbms_output.putline(emp_record.ename)
End loop
End;
BEGIN
FOR emp_record IN ( SELECT empno, ename
FROM emp) LOOP
-- implicit open and implicit fetch occur
IF emp_record.empno = 7839 THEN
...
END LOOP; -- implicit close occurs
END;
USER-DEFINED:
Declare : name the exception
Raise : explicitly raise the exception by using the raise statements
Reference: exception handing section.
The Raise_Application_Error_Procedure:
Page 115 of 262
You can use this procedure to issue user-defined error messages from stored sub programs.
You can report errors to your applications and avoid returning unhandled exceptions.
Raise_Application_Error(error_number,message[,{true/false}]
Error number between -20000 to -20999
pragma exception_init?
It tells the compiler to associate an exception with an oracle error. To get an error message of a specific
oracle error.
Ex: pragma exception_init(exception name, oracle error number)
36) What is the maximum number of statements that can be specified in a trigger statement?
One.
32) Stored procedure?
Stored procedure is a sequence of statements that perform specific function.
1) To accept the year as a parameter and list emp belong to the year?
Create or replace
Procedure empy(y number) is
Cursor emp_cursor is
Select * from emp where to_char(hiredate,’yyyy’)=’y’;
Emp_record emp%rowtype;
Begin
For emp_record in emp_cursor loop
Print (emp_record.empno);
Print (emp_record.ename);
Print (emp_record.sal);
End loop;
End;
Output :
var empx number;
Begin
:empx := ‘1234’;
End;
Exec empy(:empx);
Print empy;
54) What is function?
---- is a named pl/sql block to perform a specific task, is mainly used for calculation purpose.
---- A function is called as part of an exception.
---- Every function should return a value
Example for function
Create or replace
Function get_sal(p_id in emp.emp_no% type)
Return number
Is
v_sal emp.sal%type :=0;
Begin
Select salary into v_salary
From emp
Where emp_no = p_id;
Return v_salary
End get_sal;
End;
Output :
var g_sal number;
Exec :g_sal := get_sal(99);
Print g_salary;
Page 117 of 262
Yes.
10.Can 2 functions have same name & input parameters but differ only by return datatype
No.
Modularity
Easier Application Design
Information Hiding
Overloading
PL/SQL allows for a special subprogram declaration called a forward declaration. It consists of the
subprogram specification in the package body terminated by a semicolon. You can use forward
declarations to do the following:
• Define subprograms in logical or alphabetical order.
• Define mutually recursive subprograms.(both calling each other).
• Group subprograms in a package
PROCEDURE calc_rating(. . .)
IS
BEGIN
...
END;
END forward_pack;
Page 118 of 262
The data dictionary contains source code in the Data dictionary contains source code in
user_triggers. user_source
Commit, save point and rollback are not Those are allowed
allowed(TCL)
58) LOCKS?
-- Is to reduce concurrency
1) share lock
---it allows the other users for only reading not to insert or update or delete.
2) exclusive lock
--- only one user can have the privileges of insert or update and delete of particular object
--- others can only read.
3) update lock
----multiple user can read, update delete
Lock levels :
1) table level 2) table space 3) data base level.
Composite Datatypes :
– PL/SQL TABLES
– PL/SQL RECORDS
- Nested TABLE
- VARRAY
After starting an instance, Oracle associates the instance with the specified
database. This is called mounting the database. The database is then ready to be
opened, which makes it accessible to authorized users.
Multiple instances can execute concurrently on the same computer, each accessing
its own physical database. In clustered and massively parallel systems (MPP),
the Oracle Parallel Server allows multiple instances to mount a single database.
Page 121 of 262
Only the database administrator can start up an instance and open the database.
If a database is open, the database administrator can shut down the database so
that it is closed. When a database is closed, users cannot access the
information that it contains.
Security for database startup and shutdown is controlled via connections to
Oracle with administrator privileges. Normal users do not have control over the
current status of an Oracle database.
Q: What is a view?
A view is a tailored presentation of the data contained in one or more tables
(or other views). Unlike a table, a view is not allocated any storage space, nor
does a view actually contain data; rather, a view is defined by a query that
extracts or derives data from the tables the view references. These tables are
called base tables.
Views present a different representation of the data that resides within the
base tables. Views are very powerful because they allow you to tailor the
presentation of data to different types of users.
Views are often used to:
• provide an additional level of table security by restricting access to a
predetermined set of rows and/or columns of a table
• hide data complexity
• simplify commands for the user
• present the data in a different perspective from that of the base table
• isolate applications from changes in definitions of base tables
• express a query that cannot be expressed without using a view
Rules governing the relationships between primary keys and foreign keys of
tables within a relational database that determine data consistency. Referential
integrity requires that the value of every foreign key in every table be matched
by the value of a primary key in another table.
What is a cursor?
cursor is a private sql work area used to perform manipulations on data using pl\sql.
adv:
1.mainly used for multiple row manipulations and locking columns.
note: data which is populated into the cursor is known as active dataset.
cursors are of two types
1.implicit
2.explicit
implicit
———
attributes or properties for implicit cursor
1.sql%is open:attribute returns a boolean value stating wether the cursor is open or closed.
2.sql % found: returns boolean value stating whether the record is found in the cursor.
3.sql%notfound : returns a boolean value stating whether the record is not found in the cursor
4.sql %rowcount :returns a pneumeric value stating no.of rows executed in the cursor.
explicit cursors—retrives multiple rows.
************
adv: users can perform locks on th data in the cursor
Page 122 of 262
attributes
1.% is open
2.% found
3.% not found
4.% rowcount
Note: DATA which is populated in the cursor is known as active data set.
WE CAN WRITE TWO CURSORS IN ONE PROGRAM
WE CAN WRITE A CURSOR SPECIFYING PARAMETERS
CURSOR WITH UPDATE CLAUSE IS USED TO PERFORM LOCKS ON DATA.
Name the data dictionary that stores user-defined Stored procedures?
ans :- user_objects
Answer: The Sql Loader module of the oracle database Management System loads data into an existing
ORACLE table from an external files.It is available locally only on CMS and PCs with oracle version 5.
Throughout this documentation the CAR database described in Referance A is used for illustration.
There are several methods others than using SQL *Loader of inserting data into a table.
1. The Sql insert command may be used from the SQL * Plus module,
for Example :
insert into CAR values(…)
where the values to be inserted into a row of the table are listed inside the parentheses. Dates and
Characters data must be Surrounded by single quotes; items are seperated by commas.
2. Sql*Forms allows you to add rows interactively using forms. The forms may contain default values and
checks for invalid data.
3. ODL loads the table from a control file and separate fixed format data file. ODL is available on all versions
of ORACLE . SQL * Loader is much more flexible than ODL and will eventually supersede it on all systems.
what is a synonym ?
Ans. A synonym is an alternative name for tables,views,procedures and other database objects
generally when we have more than one schema and we wish to access an object of a different schema then
we create synonyms for that object in the schema where we wish to access the object.
Page 123 of 262
Syntax:
create synonym synonym-name for schemaname.object-name
what is an exception ?
Exception is an event that causes suspension of normal program execution.
In oracle there are serveral types of exceptions
1) Pre-defined exceptions like NO_DATA_FOUND,TOO_MANY_ROWS
2) User-defined exceptions which would validate the business logic
3) unnamed system exceptions which are raised due to errors in the application code .. you can name these
exceptions using PRAGMA EXCEPTION_INIT
4)Unnamed programmer-defined exceptions. Exceptions that are defined and raised in the server by the
programmer. In this case, the programmer provides both an error number (between -20000 and -20999) and
an error message, and raises that exception with a call to RAISE_APPLICATION_ERROR.
for all the exceptions raised oracle fills in sqleerm and sqlcode variable which provide the error message and
error code for the exception raised.
what is a schema ?
A schema is a oracle database user account.
Expected answer:
A Cartesian product is the result of an unrestricted join of two or more tables. The result set of a three table
Cartesian product will have x * y * z number of rows where x, y, z correspond to the number of rows in each
table involved in the join. It is causes by specifying a table in the FROM clause without joining it to another
table.
2. What is an advantage to using a stored procedure as opposed to passing an SQL query from an
application.
Expected answer:
A stored procedure is pre-loaded in memory for faster execution. It allows the DBMS control of permissions
for security purposes. It also eliminates the need to recompile components when minor changes occur to the
database.
Expected answer:
A LEFT JOIN will take ALL values from the first declared table and matching values from the second
declared table based on the column the join has been declared on. An INNER JOIN will take only matching
values from both tables
PL/SQL Questions:
Page 124 of 262
1. Describe the difference between a procedure, function and anonymous pl/sql block.
Expected answer : Candidate should mention use of DECLARE statement, a function must return a value
while a procedure doesn?t have to.
2. What is a mutating table error and how can you get around it?
Expected answer: This happens with triggers. It occurs because the trigger is trying to update a row it is
currently using. The usual fix involves either use of views or temporary tables so the database is selecting
from one while updating the other.
Expected answer: %ROWTYPE allows you to associate a variable with an entire table row. The %TYPE
associates a variable with a single column type.
4. What packages (if any) has Oracle provided for use by developers?
Expected answer: Oracle provides the DBMS_ series of packages. There are many which developers
should be aware of such as DBMS_SQL, DBMS_PIPE, DBMS_TRANSACTION, DBMS_LOCK,
DBMS_ALERT, DBMS_OUTPUT, DBMS_JOB, DBMS_UTILITY, DBMS_DDL, UTL_FILE. If they can
mention a few of these and describe how they used them, even better. If they include the SQL routines
provided by Oracle, great, but not really what was asked.
Expected answer: PL/SQL tables are scalar arrays that can be referenced by a binary integer. They can be
used to hold values for use in later queries or calculations. In Oracle 8 they will be able to be of the
%ROWTYPE designation, or RECORD.
The DECLARE statement is used in PL/SQL anonymous blocks such as with stand alone, non-stored
PL/SQL procedures. It must come first in a PL/SQL stand alone file if it is used.
7. In what order should a open/fetch/loop set of commands in a PL/SQL block be implemented if you use the
%NOTFOUND cursor variable in the exit when statement? Why?
Level: Intermediate
Expected answer: OPEN then FETCH then LOOP followed by the exit when. If not specified in this order will
result in the final return being done twice because of the way the %NOTFOUND is handled by PL/SQL.
8. What are SQLCODE and SQLERRM and why are they important for PL/SQL developers?
Level: Intermediate
Expected answer: SQLCODE returns the value of the error number for the last error encountered. The
SQLERRM returns the actual error message for the last error encountered. They can be used in exception
handling to report, or, store in an error log table, the error that occurred in the code. These are especially
useful for the WHEN OTHERS exception.
Level: Low
Level:Intermediate to high
Expected answer: Use the DBMS_OUTPUT package. Another possible method is to just use the SHOW
ERROR command, but this only shows errors. The DBMS_OUTPUT package can be used to show
intermediate results from loops and the status of variables as the procedure is executed. The new package
UTL_FILE can also be used.
Level:Intermediate to high
Expected Answer: There are 12 types of triggers in PL/SQL that consist of combinations of the BEFORE,
AFTER, ROW, TABLE, INSERT, UPDATE, DELETE and ALL key words:
BEFORE INSERT
DBA:
1. Give one method for transferring a table from one schema to another:
Level:Intermediate
Expected Answer: There are several possible methods, export-import, CREATE TABLE... AS SELECT, or
COPY.
2. What is the purpose of the IMPORT option IGNORE? What is it?s default setting?
Level: Low
Expected Answer: The IMPORT IGNORE option tells import to ignore "already exists" errors. If it is not
specified the tables that already exist will be skipped. If it is specified, the error is ignored and the tables
data will be inserted. The default value is N.
3. You have a rollback segment in a version 7.2 database that has expanded beyond optimal, how can it be
restored to optimal?
Level: Low
4. If the DEFAULT and TEMPORARY tablespace clauses are left out of a CREATE USER command what
happens? Is this bad or good? Why?
Page 126 of 262
Level: Low
Expected answer: The user is assigned the SYSTEM tablespace as a default and temporary tablespace.
This is bad because it causes user objects and temporary segments to be placed into the SYSTEM
tablespace resulting in fragmentation and improper table placement (only data dictionary objects and the
system rollback segment should be in SYSTEM).
5. What are some of the Oracle provided packages that DBAs should be aware of?
Expected answer: Oracle provides a number of packages in the form of the DBMS_ packages owned by the
SYS user. The packages used by DBAs may include: DBMS_SHARED_POOL, DBMS_UTILITY,
DBMS_SQL, DBMS_DDL, DBMS_SESSION, DBMS_OUTPUT and DBMS_SNAPSHOT. They may also try
to answer with the UTL*.SQL or CAT*.SQL series of SQL procedures. These can be viewed as extra credit
but aren?t part of the answer.
Level: Low
Expected answer: The Oracle system will use the default name of SYS_Cxxxx where xxxx is a system
generated number. This is bad since it makes tracking which table the constraint belongs to or what the
constraint does harder.
7. What happens if a tablespace clause is left off of a primary key constraint clause?
Level: Low
Expected answer: This results in the index that is automatically generated being placed in then users default
tablespace. Since this will usually be the same tablespace as the table is being created in, this can cause
serious performance problems.
8. What is the proper method for disabling and re-enabling a primary key constraint?
Level: Intermediate
Expected answer: You use the ALTER TABLE command for both. However, for the enable clause you must
specify the USING INDEX and TABLESPACE clause for primary keys.
9. What happens if a primary key constraint is disabled and then enabled without fully specifying the index
clause?
Level: Intermediate
Expected answer: The index is created in the user?s default tablespace and all sizing information is lost.
Oracle doesn?t store this information as a part of the constraint definition, but only as part of the index
definition, when the constraint was disabled the index was dropped and the information is gone.
10. (On UNIX) When should more than one DB writer process be used? How many should be used?
Level: High
Page 127 of 262
Expected answer: If the UNIX system being used is capable of asynchronous IO then only one is required, if
the system is not capable of asynchronous IO then up to twice the number of disks used by Oracle number
of DB writers should be specified by use of the db_writers initialization parameter.
11. You are using hot backup without being in archivelog mode, can you recover in the event of a failure?
Why or why not?
Level: High
Expected answer: You can?t use hot backup without being in archivelog mode. So no, you couldn?t recover.
12. What causes the "snapshot too old" error? How can this be prevented or mitigated?
Level: Intermediate
Expected answer: This is caused by large or long running transactions that have either wrapped onto their
own rollback space or have had another transaction write on part of their rollback space. This can be
prevented or mitigated by breaking the transaction into a set of smaller transactions or increasing the size of
the rollback segments and their extents.
Level: Low
Expected answer: By checking the status column of the DBA_, ALL_ or USER_OBJECTS views, depending
upon whether you own or only have permission on the view or are using a DBA account.
14. A user is getting an ORA-00942 error yet you know you have granted them permission on the table, what
else should you check?
Level: Low
Expected answer: You need to check that the user has specified the full name of the object (select empid
from scott.emp; instead of select empid from emp;) or has a synonym that points to the object (create
synonym emp for scott.emp;)
15. A developer is trying to create a view and the database won?t let him. He has the "DEVELOPER" role
which has the "CREATE VIEW" system privilege and SELECT grants on the tables he is using, what is the
problem?
Level: Intermediate
Expected answer: You need to verify the developer has direct grants on all tables used in the view. You can?
t create a stored object with grants given through views.
16. If you have an example table, what is the best way to get sizing data for the production table
implementation?
Level: Intermediate
Expected answer: The best way is to analyze the table and then use the data provided in the DBA_TABLES
view to get the average row length and other pertinent data for the calculation. The quick and dirty way is to
look at the number of blocks the table is actually using and ratio the number of rows in the table to its
number of blocks against the number of expected rows.
Page 128 of 262
17. How can you find out how many users are currently logged into the database? How can you find their
operating system id?
Level: high
Expected answer: There are several ways. One is to look at the v$session or v$process views. Another way
is to check the current_logins parameter in the v$sysstat view. Another if you are on UNIX is to do a "ps -ef|
grep oracle|wc -l? command, but this only works against a single instance installation.
18. A user selects from a sequence and gets back two values, his select is:
Level: Intermediate
Expected answer: Somehow two values have been inserted into the dual table. This table is a single row,
single column table that should only have one value in it.
19. How can you determine if an index needs to be dropped and rebuilt?
Level: Intermediate
Expected answer: Run the ANALYZE INDEX command on the index to validate its structure and then
calculate the ratio of LF_BLK_LEN/LF_BLK_LEN+BR_BLK_LEN and if it isn?t near 1.0 (i.e. greater than 0.7
or so) then the index should be rebuilt. Or if the ratio
SQL/ SQLPlus
Level: Low
Expected answer: By use of the & symbol. For passing in variables the numbers 1-8 can be used (&1,
&2,...,&8) to pass the values after the command into the SQLPLUS session. To be prompted for a specific
variable, place the ampersanded variable in the code itself:
"select * from dba_tables where owner=&owner_name;" . Use of double ampersands tells SQLPLUS to
resubstitute the value for each subsequent use of the variable, a single ampersand will cause a reprompt for
the value unless an ACCEPT statement is used to get the value from the user.
2. You want to include a carriage return/linefeed in your output from a SQL script, how can you do this?
Expected answer: The best method is to use the CHR() function (CHR(10) is a return/linefeed) and the
concatenation function "||". Another method, although it is hard to document and isn?t always portable is to
use the return/linefeed as a part of a quoted string.
Level: Intermediate
Page 129 of 262
4. How do you execute a host operating system command from within SQL?
Level: Low
Expected answer: By use of the exclamation point "!" (in UNIX and some other OS) or the HOST (HO)
command.
5. You want to use SQL to build SQL, what is this called and give an example
spool drop_all.sql
spool off
Essentially you are looking to see that they know to include a command (in this case DROP
USER...CASCADE;) and that you need to concatenate using the ?||? the values selected from the database.
Level: low
7. You want to group the following set of select returns, what can you group on?
Level: Intermediate
Expected answer: The only column that can be grouped on is the "item_no" column, the rest have aggregate
functions associated with them.
8. What special Oracle feature allows you to specify how the cost based system treats a SQL statement?
Expected answer: The COST based system allows the use of HINTs to control the optimizer path selection.
If they can give some example hints such as FIRST ROWS, ALL ROWS, USING INDEX, STAR, even better.
9. You want to determine the location of identical rows in a table before attempting to place a unique index
on the table, how can this be done?
Level: High
Page 130 of 262
Expected answer: Oracle tables always have one guaranteed unique column, the rowid column. If you use a
min/max function against your rowid and then select against the proposed primary key you can squeeze out
the rowids of the duplicate rows pretty quick. For example:
from emp x
In the situation where multiple columns make up the proposed key, they must all be used in the where
clause.
Level: Low
Expected answer: A Cartesian product is the result of an unrestricted join of two or more tables. The result
set of a three table Cartesian product will have x * y * z number of rows where x, y, z correspond to the
number of rows in each table involved in the join.
11. You are joining a local and a remote table, the network manager complains about the traffic involved,
how can you reduce the network traffic?
Level: High
Expected answer: Push the processing of the remote data to the remote instance by using a view to pre-
select the information for the join. This will result in only the data required for the join being sent across.
Level: Low
Expected answer: The tkprof tool is a tuning tool used to determine cpu and execution times for SQL
statements. You use it by first setting timed_statistics to true in the initialization file and then turning on
tracing for either the entire database via the sql_trace parameter or for the session using the ALTER
SESSION command. Once the trace file is generated you run the tkprof tool against the trace file and then
look at the output from the tkprof tool. This can also be used to generate explain plan output.
Expected answer: The EXPLAIN PLAN command is a tool to tune SQL statements. To use it you must have
an explain_table generated in the user you are running the explain plan for. This is created using the
utlxplan.sql script. Once the explain plan table exists you run the explain plan command giving as its
Page 131 of 262
argument the SQL statement to be explained. The explain_plan table is then queried to see the execution
plan of the statement. Explain plans can also be run using tkprof.
15. How do you set the number of lines on a page of output? The width?
Level: Low
Expected answer: The SET command in SQLPLUS is used to control the number of lines generated per
page and the width of those lines, for example SET PAGESIZE 60 LINESIZE 80 will generate reports that
are 60 lines long with a line width of 80 characters. The PAGESIZE and LINESIZE options can be shortened
to PAGES and LINES.
Level: Low
Expected answer: The SET option TERMOUT controls output to the screen. Setting TERMOUT OFF turns
off screen output. This option can be shortened to TERM.
17. How do you prevent Oracle from giving you informational messages during and after a SQL statement
execution?
Level: Low
Expected answer: The SET options FEEDBACK and VERIFY can be set to OFF.
Level: Low
Tuning Questions:
1. A tablespace has a table with 30 extents in it. Is this bad? Why or why not.
Level: Intermediate
Expected answer: Multiple extents in and of themselves aren?t bad. However if you also have chained rows
this can hurt performance.
Level: Low
Expected answer: You should always attempt to use the Oracle Flexible Architecture standard or another
partitioning scheme to ensure proper separation of SYSTEM, ROLLBACK, REDO LOG, DATA,
TEMPORARY and INDEX segments.
3. You see multiple fragments in the SYSTEM tablespace, what should you check first?
Level: Low
Page 132 of 262
Expected answer: Ensure that users don?t have the SYSTEM tablespace as their TEMPORARY or
DEFAULT tablespace assignment by checking the DBA_USERS view.
4. What are some indications that you need to increase the SHARED_POOL_SIZE parameter?
Level: Intermediate
Expected answer: Poor data dictionary or library cache hit ratios, getting error ORA-04031. Another
indication is steadily decreasing performance with all other tuning parameters the same.
5. What is the general guideline for sizing db_block_size and db_multi_block_read for an application that
does many full table scans?
Level: High
Expected answer: Oracle almost always reads in 64k chunks. The two should have a product equal to 64 or
a multiple of 64.
Level: Intermediate
7. Explain the use of TKPROF? What initialization parameter should be turned on to get full TKPROF
output?
Level: High
Expected answer: The tkprof tool is a tuning tool used to determine cpu and execution times for SQL
statements. You use it by first setting timed_statistics to true in the initialization file and then turning on
tracing for either the entire database via the sql_trace parameter or for the session using the ALTER
SESSION command. Once the trace file is generated you run the tkprof tool against the trace file and then
look at the output from the tkprof tool. This can also be used to generate explain plan output.
8. When looking at v$sysstat you see that sorts (disk) is high. Is this bad or good? If bad -How do you
correct it?
Level: Intermediate
Expected answer: If you get excessive disk sorts this is bad. This indicates you need to tune the sort area
parameters in the initialization files. The major sort are parameter is the SORT_AREA_SIZe parameter.
9. When should you increase copy latches? What parameters control copy latches?
Level: high
Expected answer: When you get excessive contention for the copy latches as shown by the "redo copy"
latch hit ratio. You can increase copy latches via the initialization parameter
LOG_SIMULTANEOUS_COPIES to twice the number of CPUs on your system.
10. Where can you get a list of all initialization parameters for your instance? How about an indication if they
are default settings or have been changed?
Level: Low
Page 133 of 262
Expected answer: You can look in the init.ora file for an indication of manually set parameters. For all
parameters, their value and whether or not the current value is the default value, look in the v$parameter
view.
11. Describe hit ratio as it pertains to the database buffers. What is the difference between instantaneous
and cumulative hit ratio and which should be used for tuning?
Level: Intermediate
Expected answer: The hit ratio is a measure of how many times the database was able to read a value from
the buffers verses how many times it had to re-read a data value from the disks. A value greater than 80-
90% is good, less could indicate problems. If you simply take the ratio of existing parameters this will be a
cumulative value since the database started. If you do a comparison between pairs of readings based on
some arbitrary time span, this is the instantaneous ratio for that time span. Generally speaking an
instantaneous reading gives more valuable data since it will tell you what your instance is doing for the time
it was generated over.
12. Discuss row chaining, how does it happen? How can you reduce it? How do you correct it?
Level: high
Expected answer: Row chaining occurs when a VARCHAR2 value is updated and the length of the new
value is longer than the old value and won?t fit in the remaining block space. This results in the row chaining
to another block. It can be reduced by setting the storage parameters on the table to appropriate values. It
can be corrected by export and import of the effected table.
13. When looking at the estat events report you see that you are getting busy buffer waits. Is this bad? How
can you find what is causing it?
Level: high
Expected answer: Buffer busy waits could indicate contention in redo, rollback or data blocks. You need to
check the v$waitstat view to see what areas are causing the problem. The value of the "count" column tells
where the problem is, the "class" column tells you with what. UNDO is rollback segments, DATA is data base
buffers.
14. If you see contention for library caches how can you fix it?
Level: Intermediate
15. If you see statistics that deal with "undo" what are they really talking about?
Level: Intermediate
16. If a tablespace has a default pctincrease of zero what will this cause (in relationship to the smon
process)?
Level: High
Expected answer: The SMON process won?t automatically coalesce its free space fragments.
Page 134 of 262
17. If a tablespace shows excessive fragmentation what are some methods to defragment the tablespace?
(7.1,7.2 and 7.3 only)
Level: High
Expected answer: In Oracle 7.0 to 7.2 The use of the 'alter session set events 'immediate trace name
coalesce level ts#';? command is the easiest way to defragment contiguous free space fragmentation. The
ts# parameter corresponds to the ts# value found in the ts$ SYS table. In version 7.3 the ?alter tablespace
coalesce;? is best. If the free space isn?t contiguous then export, drop and import of the tablespace contents
may be the only way to reclaim non-contiguous free space.
Level: Intermediate
If a select against the dba_free_space table shows that the count of a tablespaces extents is greater than
the count of its data files, then it is fragmented.
Is this something to worry about? What if redo log space wait time is high? How can you fix this?
Level: Intermediate
Expected answer: Since the wait time is zero, no. If the wait time was high it might indicate a need for more
or larger redo logs.
20. What can cause a high value for recursive calls? How can this be fixed?
Level: High
Expected answer: A high value for recursive calls is cause by improper cursor usage, excessive dynamic
space management actions, and or excessive statement re-parses. You need to determine the cause and
correct it By either relinking applications to hold cursors, use proper space management techniques (proper
storage and sizing) or ensure repeat queries are placed in packages for proper reuse.
21. If you see a pin hit ratio of less than 0.8 in the estat library cache report is this a problem? If so, how do
you fix it?
Level: Intermediate
Expected answer: This indicate that the shared pool may be too small. Increase the shared pool size.
22. If you see the value for reloads is high in the estat library cache report is this a matter for concern?
Level: Intermediate
Expected answer: Yes, you should strive for zero reloads if possible. If you see excessive reloads then
increase the size of the shared pool.
Page 135 of 262
23. You look at the dba_rollback_segs view and see that there is a large number of shrinks and they are of
relatively small size, is this a problem? How can it be fixed if it is a problem?
Level: High
Expected answer: A large number of small shrinks indicates a need to increase the size of the rollback
segment extents. Ideally you should have no shrinks or a small number of large shrinks. To fix this just
increase the size of the extents and adjust optimal accordingly.
24. You look at the dba_rollback_segs view and see that you have a large number of wraps is this a
problem?
Level: High
Expected answer: A large number of wraps indicates that your extent size for your rollback segments are
probably too small. Increase the size of your extents to reduce the number of wraps. You can look at the
average transaction size in the same view to get the information on transaction size.
25. In a system with an average of 40 concurrent users you get the following from a query on rollback
extents:
--------------------- --------------------------
R01 11
R02 8
R03 12
R04 9
SYSTEM 4
You have room for each to grow by 20 more extents each. Is there a problem? Should you take any action?
Level: Intermediate
Expected answer: No there is not a problem. You have 40 extents showing and an average of 40 concurrent
users. Since there is plenty of room to grow no action is needed.
26. You see multiple extents in the temporary tablespace. Is this a problem?
Level: Intermediate
Expected answer: As long as they are all the same size this isn?t a problem. In fact, it can even improve
performance since Oracle won?t have to create a new extent when a user needs one.
Installation/Configuration
1. Define OFA.
Level: Low
Page 136 of 262
Expected answer: OFA stands for Optimal Flexible Architecture. It is a method of placing directories and files
in an Oracle system so that you get the maximum flexibility for future tuning and file placement.
Level: Low
Expected answer: The answer here should show an understanding of separation of redo and rollback, data
and indexes and isolation os SYSTEM tables from other tables. An example would be to specify that at least
7 disks should be used for an Oracle installation so that you can place SYSTEM tablespace on one, redo
logs on two (mirrored redo logs) the TEMPORARY tablespace on another, ROLLBACK tablespace on
another and still have two for DATA and INDEXES. They should indicate how they will handle archive logs
and exports as well. As long as they have a logical plan for combining or further separation more or less
disks can be specified.
3. What should be done prior to installing Oracle (for the OS and the disks)?
Level: Low
Expected Answer: adjust kernel parameters or OS tuning parameters in accordance with installation guide.
Be sure enough contiguous disk space is available.
4. You have installed Oracle and you are now setting up the actual instance. You have been waiting an hour
for the initialization script to finish, what should you check first to determine if there is a problem?
Expected Answer: Check to make sure that the archiver isn?t stuck. If archive logging is turned on during
install a large number of logs will be created. This can fill up your archive log destination causing Oracle to
stop to wait for more space.
5. When configuring SQLNET on the server what files must be set up?
Level: Intermediate
6. When configuring SQLNET on the client what files need to be set up?
Level: Intermediate
7. What must be installed with ODBC on the client in order for it to work with Oracle?
Level: Intermediate
Expected answer: SQLNET and PROTOCOL (for example: TCPIP adapter) layers of the transport
programs.
8. You have just started a new instance with a large SGA on a busy existing server. Performance is terrible,
what should you check for?
Level: Intermediate
Page 137 of 262
Expected answer: The first thing to check with a large SGA is that it isn?t being swapped out.
9. What OS user should be used for the first part of an Oracle installation (on UNIX)?
Level: low
10. When should the default values for Oracle initialization parameters be used as is?
Level: Low
11. How many control files should you have? Where should they be located?
Level: Low
Expected answer: At least 2 on separate disk spindles. Be sure they say on separate disks, not just file
systems.
12. How many redo logs should you have and how should they be configured for maximum recoverability?
Level: Intermediate
Expected answer: You should have at least three groups of two redo logs with the two logs each on a
separate disk spindle (mirrored by Oracle). The redo logs should not be on raw devices on UNIX if it can be
avoided.
13. You have a simple application with no "hot" tables (i.e. uniform IO and access requirements). How many
disks should you have assuming standard layout for SYSTEM, USER, TEMP and ROLLBACK tablespaces?
Data Modeler:
Level: Low
Expected answer: Something like: In third normal form all attributes in an entity are related to the primary
key and only to the primary key
Level: Intermediate
Expected answer: False. While 3NF is good for logical design most databases, if they have more than just a
few tables, will not perform well using full 3NF. Usually some entities will be denormalized in the logical to
physical transfer process.
Page 138 of 262
3. What is an ERD?
Level: Low
Level: Intermediate
A recursive relationship (one where a table relates to itself) is bad when it is a hard relationship (i.e. neither
side is a "may" both are "must") as this can result in it not being possible to put in a top or perhaps a bottom
of the table (for example in the EMPLOYEE table you couldn?t put in the PRESIDENT of the company
because he has no boss, or the junior janitor because he has no subordinates). These type of relationships
are usually resolved by adding a small intersection entity.
5. What does a hard one-to-one relationship mean (one where the relationship on both ends is "must")?
Expected answer: This means the two entities should probably be made into one entity.
Level: Intermediate
7. What is an artificial (derived) primary key? When should an artificial (or derived) primary key be used?
Level: Intermediate
Expected answer: A derived key comes from a sequence. Usually it is used when a concatenated key
becomes too cumbersome to use as a foreign key.
Level: Intermediate
UNIX:
Level: Low
Expected answer: There are several commands to do this: du, df, or bdf
2. How can you determine the number of SQLNET users logged in to the UNIX system?
Level: Intermediate
Page 139 of 262
Expected answer: SQLNET users will show up with a process unique name that begins with oracle, if you do
a ps -ef|grep oracle|wc -l you can get a count of the number of users.
Level: Low
Level: Low
Expected answer: rm
Level: Low
Level: intermediate
Level: Low
Expected answer: grep is a string search command that parses the specified string from the specified file or
files
8. The system has a program that always includes the word nocomp in its name, how can you determine the
number of processes that are using this program?
Level: intermediate
9. What is an inode?
Level: Intermediate
Expected answer: an inode is a file status indicator. It is stored in both disk and memory and tracts file
status. There is one inode for each file on the system.
10. The system administrator tells you that the system hasn?t been rebooted in 6 months, should he be
proud of this?
Level: High
Page 140 of 262
Expected answer: Maybe. Some UNIX systems don?t clean up well after themselves. Inode problems and
dead user processes can accumulate causing possible performance and corruption problems. Most UNIX
systems should have a scheduled periodic reboot so file systems can be checked and cleaned and dead or
zombie processes cleared out.
Level: Intermediate
Expected answer: redirection is the process by which input or output to or from a process is redirected to
another process. This can be done using the pipe symbol "|", the greater than symbol ">" or the "tee"
command. This is one of the strengths of UNIX allowing the output from one command to be redirected
directly into the input of another command.
Level: Intermediate
13. How can you find all the processes on your system?
Level: Low
Level: Low
Level: Low
Expected answer: The finger command uses data in the passwd file to give information on system users.
Level: Low
Level: Intermediate
Expected answer: The ">>" redirection symbol appends the output from the command specified into the file
specified. The file must already have been created.
18. If you aren?t sure what command does a particular UNIX function what is the best way to determine the
command?
Page 141 of 262
Expected answer: The UNIX man -k command will search the man pages for the value specified. Review the
results from the command to find the command of interest.
Oracle Troubleshooting:
1. How can you determine if an Oracle instance is up from the operating system level?
Level: Low
Expected answer: There are several base Oracle processes that will be running on multi-user operating
systems, these will be smon, pmon, dbwr and lgwr. Any answer that has them using their operating system
process showing feature to check for these is acceptable. For example, on UNIX a ps -ef|grep dbwr will
show what instances are up.
Level: Low
ORA-06114: (Cnct err, can't get err txt. See Servr Msgs & Codes Manual)
Expected answer: The instance name is probably incorrect in their connection string.
3. Users from the PC clients are getting the following error stack:
Level: Low
Expected answer: The Oracle instance is shutdown that they are trying to access, restart the instance.
4. How can you determine if the SQLNET process is running for SQLNET V1? How about V2?
Level: Low
Expected answer: For SQLNET V1 check for the existence of the orasrv process. You can use the command
"tcpctl status" to get a full status of the V1 TCPIP server, other protocols have similar command formats. For
SQLNET V2 check for the presence of the LISTENER process(s) or you can issue the command "lsnrctl
status".
5. What file will give you Oracle instance status information? Where is it located?
Level: Low
Expected answer: The alert.ora log. It is located in the directory specified by the background_dump_dest
parameter in the v$parameter table.
Page 142 of 262
6. Users aren?t being allowed on the system. The following message is received:
Level: Intermediate
Expected answer: The archive destination is probably full, backup the archive logs and remove them and the
archiver will re-start.
7. Where would you look to find out if a redo log was corrupted assuming you are using Oracle mirrored
redo logs?
Level: Intermediate
Expected answer: There is no message that comes to the SQLDBA or SRVMGR programs during startup in
this situation, you must check the alert.log file for this information.
Level: Intermediate
Expected answer: When the database was created the db_files parameter in the initialization file was set to
40. You can shutdown and reset this to a higher value, up to the value of MAX_DATAFILES as specified at
database creation. If the MAX_DATAFILES is set to low, you will have to rebuild the control file to increase it
before proceeding.
9. You look at your fragmentation report and see that smon hasn?t coalesced any of you tablespaces, even
though you know several have large chunks of contiguous free extents. What is the problem?
Level: High
Expected answer: Check the dba_tablespaces view for the value of pct_increase for the tablespaces. If
pct_increase is zero, smon will not coalesce their free space.
Level: Intermediate
Expected answer: The number of DML Locks is set by the initialization parameter DML_LOCKS. If this value
is set to low (which it is by default) you will get this error. Increase the value of DML_LOCKS. If you are sure
that this is just a temporary problem, you can have them wait and then try again later and the error should
clear.
11. You get a call from you backup DBA while you are on vacation. He has corrupted all of the control files
while playing with the ALTER DATABASE BACKUP CONTROLFILE command. What do you do?
Page 143 of 262
Level: High
Expected answer: As long as all datafiles are safe and he was successful with the BACKUP controlfile
command you can do the following:
CONNECT INTERNAL
STARTUP MOUNT
(Take any read-only tablespaces offline before next step ALTER DATABASE DATAFILE .... OFFLINE;)
If they have a recent output file from the ALTER DATABASE BACKUP CONTROL FILE TO TRACE;
command, they can use that to recover as well.
If no backup of the control file is available then the following will be required:
CONNECT INTERNAL
STARTUP NOMOUNT
However, they will need to know all of the datafiles, logfiles, and settings for MAXLOGFILES,
MAXLOGMEMBERS, MAXLOGHISTORY, MAXDATAFILES for the database to use the command.
Lets you register an application name with the database for auditing or
DBMS_APPLICATION_INFO performance tracking purposes.
Page 144 of 262
Provides access to some SQL DDL statements from stored procedures, and
DBMS_DDL provides special administration operations not available as DDLs.
A PL/SQL API to the PL/SQL debugger layer, Probe, in the Oracle server.
DBMS_DEBUG
Permits querying the deferred remote procedure calls (RPC) queue data that is
DBMS_DEFER_QUERY not exposed through views. Requires the Distributed Option.
Describes the arguments of a stored procedure with full name translation and
DBMS_DESCRIBE security checking.
Lets you create and modify objects in the Heterogeneous Services dictionary.
DBMS_HS
Creates a table into which references to the chained rows for an Index
DBMS_IOT Organized Table can be placed using the ANALYZE command.
Lets you request, convert and release locks through Oracle Lock Management
DBMS_LOCK services.
Queries the dictionary tables of the current database, and creates a text based
DBMS_LOGMNR_D file containing their contents.
Provides a Probe Profiler API to profile existing PL/SQL applications and identify
DBMS_PROFILER performance bottlenecks.
Page 146 of 262
Provides APIs used to detect and resolve data inconsistencies between two
DBMS_RECTIFIER_DIFF replicated sites.
Lets you create users with the privileges needed by the symmetric replication
DBMS_REPCAT_ADMIN facility. Requires the Replication Option.
Provides routines to generate shadow tables, triggers, and packages for table
DBMS_REPUTIL replication.
Lets you keep objects in shared memory, so that they will not be aged out with
DBMS_SHARED_POOL the normal LRU mechanism.
Lets you refresh snapshots that are not part of the same refresh group and
DBMS_SNAPSHOT purge logs. Requires the Distributed Option.
(synonym DBMS_MVIEW)
Provides segment space information not available through standard SQL.
DBMS_SPACE
Provides language facilities that help your application interact with Oracle.
DBMS_STANDARD
Provides a mechanism for users to view and modify optimizer statistics gathered
DBMS_STATS for database objects.
Provides functions for migrating spatial data from release 7.3.3 and 7.3.4 to
SDO_MIGRATE 8.1.x.
Provides functions for selecting parameters that determine the behavior of the
SDO_TUNE spatial indexing scheme used in the Spatial Cartridge.
Enables your PL/SQL programs to read and write operating system (OS) text
UTL_FILE files and provides a restricted version of standard OS stream file I/O.
Enables HTTP callouts from PL/SQL and SQL to access data on the Internet or
UTL_HTTP to call Oracle Web Server Cartridges.
Page 149 of 262
Provides functions for converting COBOL numeric data into Oracle numbers and
UTL_PG Oracle numbers into COBOL numeric data.
Provides SQL functions for RAW datatypes that concat, substr, etc. to and from
UTL_RAW RAWS.
Structured Query Language (SQL) is a language that provides an interface to relational database
systems. SQL was developed by IBM in the 1970s for use in System R, and is a de facto standard, as well
as an ISO and ANSI standard. SQL is often pronounced SEQUEL.
In common usage SQL also encompasses DML (Data Manipulation Language), for INSERTs,
UPDATEs, DELETEs and DDL (Data Definition Language), used for creating and modifying tables and other
database structures.
The development of SQL is governed by standards. A major revision to the SQL standard was
completed in 1992, called SQL2. SQL3 support object extensions and will be (partially?) implemented in
Oracle8.
2. What are the difference between DDL, DML and DCL commands?
TRUNCATE - remove all records from a table, including all spaces allocated for the records are
removed
3. How does one escape special characters when building SQL queries?
The LIKE keyword allows for string searches. The '_' wild card character is used to match exactly
one character, '%' is used to match zero or more occurrences of any characters. These characters can be
escaped in SQL. Example:
Choose one of the following queries to identify or remove duplicate rows from a table leaving
unique records in the table:
Method 1:
Method 2:
Note: If you create an index on the joined fields in the inner loop, you, for all intents purposes, eliminate N^2
operations (no need to loop through the entire table on each pass by a record). This will speed-up th
Note 2: If you are comparing NOT-NULL columns, use the NVL function. Remember that NULL is not equal
to NULL. This should not be a problem as all key columns should be NOT NULL.
Create your table with a NOT NULL column (say SEQNO). This column can now be populated with
unique values:
6. How can I get the time difference between two date columns
select floor(((date1-date2)*24*60*60)/3600)
|| ' HOURS ' ||
floor((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600)/60)
|| ' MINUTES ' ||
round((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600 -
(floor((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600)/60)*60)))
|| ' SECS ' time_difference
from ...
Page 152 of 262
The SYSDATE pseudo-column shows the current system date and time. Adding 1 to SYSDATE will
advance the date by 1 day. Use fractions to add hours, minutes or seconds to the date. Look at these
examples:
SQL> select sysdate, sysdate+1/24, sysdate +1/1440, sysdate + 1/86400 from dual;
NOW NOW_PLUS_30_SECS
-------------------- --------------------
03-JUL-2002 16:47:23 03-JUL-2002 16:47:53
select f2,
sum(decode(greatest(f1,59), least(f1,100), 1, 0)) "Range 60-100",
sum(decode(greatest(f1,30), least(f1, 59), 1, 0)) "Range 30-59",
sum(decode(greatest(f1, 0), least(f1, 29), 1, 0)) "Range 00-29"
from my_table
group by f2;
For equal size ranges it might be easier to calculate it with DECODE(TRUNC(value/range), 0, rate_0, 1,
rate_1, ...). Eg.
10. Can one retrieve only the Nth row from a table?
SELECT f1 FROM t1
WHERE rowid = (
SELECT rowid FROM t1
WHERE rownum <= 10
MINUS
SELECT rowid FROM t1
WHERE rownum < 10);
Alternatively...
Please note, there is no explicit row order in a relational database. However, this query is quite fun and may
even help in the odd situation.
SELECT *
FROM tableX
WHERE rowid in (
SELECT rowid FROM tableX
WHERE rownum <= 7
MINUS
SELECT rowid FROM tableX
WHERE rownum < 5);
Please note, there is no explicit row order in a relational database. However, this query is quite fun and may
even help in the odd situation.
12. How does one select EVERY Nth row from a table?
One can easily select all even, odd, or Nth rows from a table using SQL queries like this:
SELECT *
FROM emp
Page 154 of 262
SELECT *
FROM ( SELECT rownum rn, empno, ename
FROM emp
) temp
WHERE MOD(temp.ROWNUM,4) = 0;
Please note, there is no explicit row order in a relational database. However, these queries are quite fun and
may even help in the odd situation.
13. How does one select the TOP N rows from a table?
Form Oracle8i one can have an inner-query with an ORDER BY clause. Look at this example:
SELECT *
FROM (SELECT * FROM my_table ORDER BY col_name_1 DESC)
WHERE ROWNUM < 10;
SELECT *
FROM my_table a
WHERE 10 >= (SELECT COUNT(DISTINCT maxcol)
FROM my_table b
WHERE b.maxcol >= a.maxcol)
ORDER BY maxcol DESC;
Tree-structured queries are definitely non-relational (enough to kill Codd and make him roll in his grave).
Also, this feature is not often found in other database offerings.
The SCOTT/TIGER database schema contains a table EMP with a self-referencing relation (EMPNO and
MGR columns). This table is perfect for tesing and demonstrating tree-structured queries as the MGR
column contains the employee number of the "current" employee's boss.
The LEVEL pseudo-column is an indication of how deep in the tree one is. Oracle can handle queries with a
depth of up to 255 levels. Look at this example:
One can produce an indented report by using the level number to substring or lpad() a series of spaces, and
concatenate that to the string. Look at this example:
One uses the "start with" clause to specify the start of the tree. More than one record can match the starting
condition. One disadvantage of having a "connect by prior" clause is that you cannot perform a join to other
tables. The "connect by prior" clause is rarely implemented in the other database offerings. Trying to do this
programmatically is difficult as one has to do the top level query first, then, for each of the records open a
cursor to look for child nodes.
One way of working around this is to use PL/SQL, open the driving cursor with the "connect by prior"
statement, and the select matching records from other tables on a row-by-row basis, inserting the results
into a temporary table for later retrieval.
SELECT *
FROM (SELECT job,
sum(decode(deptno,10,sal)) DEPT10,
sum(decode(deptno,20,sal)) DEPT20,
sum(decode(deptno,30,sal)) DEPT30,
sum(decode(deptno,40,sal)) DEPT40
FROM scott.emp
GROUP BY job)
ORDER BY 1;
The Oracle decode function acts like a procedural statement inside an SQL statement to return different
values or columns based on the values of other columns in the select statement.
Some examples:
from employees;
select decode( GREATEST(A,B), A, 'A is greater than B', 'B is greater than A')...
Note: The decode function is not ANSI SQL and is rarely implemented in other RDBMS offerings. It is one of
the good things about Oracle, but use it sparingly if portability is required.
From Oracle 8i one can also use CASE statements in SQL. Look at this example:
SELECT ename, CASE WHEN sal>1000 THEN 'Over paid' ELSE 'Under paid' END
FROM emp;
17. How can one dump/ examine the exact content of a database column?
SELECT DUMP(col1)
FROM tab1
WHERE cond1 = val1;
DUMP(COL1)
-------------------------------------
Typ=96 Len=4: 65,66,67,32
For this example the type is 96, indicating CHAR, and the last byte in the column is 32, which is the ASCII
code for a space. This tells us that this column is blank-padded.
From Oracle8i one can DROP a column from a table. Look at this sample script, demonstrating the ALTER
TABLE table_name DROP COLUMN column_name; command.
Other workarounds:
Issue the following SQL command: ALTER USER <username> IDENTIFIED BY <new_password>
/
From Oracle8 you can just type "password" from SQL*Plus, or if you need to change another user's
password, type "password user_name".
Perform an "ALTER SEQUENCE ... NOCACHE" to unload the unused cached sequence numbers from the
Oracle library cache. This way, no cached numbers will be lost. If you then select from the
USER_SEQUENCES dictionary view, you will see the correct high water mark value that would be returned
for the next NEXTVALL call. Afterwards, perform an "ALTER SEQUENCE ... CACHE" to restore caching.
You can use the above technique to prevent sequence number loss before a SHUTDOWN ABORT, or any
other operation that would cause gaps in sequence values.
You can use the SQL*Plus COPY command instead of snapshots if you need to copy LONG and LONG
RAW variables from one location to another. Eg:
COPY TO SCOTT/TIGER@REMOTE -
CREATE IMAGE_TABLE USING -
Page 158 of 262
Note: If you run Oracle8, convert your LONGs to LOBs, as it can be replicated.
From sql1992.txt:
AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH, COMPLETION, CALL, CYCLE, DATA,
DEPTH, DICTIONARY, EACH, ELSEIF, EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP,
MODIFY, NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF, REFERENCING,
REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE, ROW, SAVEPOINT, SEARCH,
SENSITIVE, SEQUENCE, SIGNAL, SIMILAR, SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST,
THERE, TRIGGER, TYPE, UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN, BIT, BIT_LENGTH,
BOTH, CASCADE, CASCADED, CASE, CAST, CATALOG, CHAR_LENGTH, CHARACTER_LENGTH,
COALESCE, COLLATE, COLLATION, COLUMN, CONNECT, CONNECTION, CONSTRAINT,
CONSTRAINTS, CONVERT, CORRESPONDING, CROSS, CURRENT_DATE, CURRENT_TIME,
CURRENT_TIMESTAMP, CURRENT_USER, DATE, DAY, DEALLOCATE, DEFERRABLE, DEFERRED,
DESCRIBE, DESCRIPTOR, DIAGNOSTICS, DISCONNECT, DOMAIN, DROP, ELSE, END-EXEC,
EXCEPT, EXCEPTION, EXECUTE, EXTERNAL, EXTRACT, FALSE, FIRST, FULL, GET, GLOBAL,
HOUR, IDENTITY, IMMEDIATE, INITIALLY, INNER, INPUT, INSENSITIVE, INTERSECT, INTERVAL,
ISOLATION, JOIN, LAST, LEADING, LEFT, LEVEL, LOCAL, LOWER, MATCH, MINUTE, MONTH,
NAMES, NATIONAL, NATURAL, NCHAR, NEXT, NO, NULLIF, OCTET_LENGTH, ONLY, OUTER,
OUTPUT, OVERLAPS, PAD, PARTIAL, POSITION, PREPARE, PRESERVE, PRIOR, READ, RELATIVE,
RESTRICT, REVOKE, RIGHT, ROWS, SCROLL, SECOND, SESSION, SESSION_USER, SIZE, SPACE,
SQLSTATE, SUBSTRING, SYSTEM_USER, TEMPORARY, THEN, TIME, TIMESTAMP,
TIMEZONE_HOUR, TIMEZONE_MINUTE, TRAILING, TRANSACTION, TRANSLATE, TRANSLATION,
TRIM, TRUE, UNKNOWN, UPPER, USAGE, USING, VALUE, VARCHAR, VARYING, WHEN, WRITE,
YEAR, ZONE
Page 159 of 262
The following error means the dba functions have not been installed:
As the owner of a database, you can install the functions like this:
% cd $MI_HOME/examples/dba_funcs
% make MI_DATABASE=your_dbname all
The Illustra system adminstrator can install these functions in the template1 database so a database will
automatically get them at the time it is created.
The DBA functions are fully documented in Chapter 6 of the Illustra System Administrator's Guide. Here is
the summary list from that reference:
* return('now'::abstime) as Now;
-------------------------------------
|Now |
-------------------------------------
|Mon Apr 18 09:06:10.490753 1994 PDT|
-------------------------------------
one row selected
---------------
|Month |
---------------
|Apr |
---------------
one row selected
For more examples, see section 3.5.7.2 in the Illustra User's Guide.
This method describes how to remove duplicate entries from a table by using the oid. Syntax is for Illustra
Version 2.
Here is the original state of table foo that has duplicate entries for Donald Duck:
The goal is to leave the row with the lowest oid in place (202f.2001 in this example) and to delete all rows
with an oid higher than this one (202f.2003 in this example). The steps are to:
1. Find all rows that have an oid greater than the min oid.
2. * select f1.oid, f1.first_name, f1.last_name
3. from foo f1
4. where f1.oid::text >
5. (select min(f2.oid::text)
6. from foo f2
7. where f1.first_name=f2.first_name
8. and f1.last_name=f2.last_name);
9. -------------------------------------------
10. |oid |first_name |last_name |
11. -------------------------------------------
12. |202f.2003 |Donald |Duck |
13. -------------------------------------------
14. one row selected
15. Delete all rows that have an oid greater than the min oid.
Change the select query to actually delete the duplicate row. Do this inside a transaction; and don't
commit the change unless the results look correct.
16. * begin transaction;
17. * delete from foo f1
18. where f1.oid::text >
19. (select min(f2.oid::text)
20. from foo f2
21. where f1.first_name=f2.first_name
22. and f1.last_name=f2.last_name);
23. one row deleted
24.
Page 163 of 262
Cartesian Products
When you join tables, make sure that the number of join predicates in the search condition is one less than
the number of tables in the from list. Otherwise, you will get many more rows returned than you probably
intended. For example, table english and spanish look like this:
If you select from both tables without joining them in the where clause, you get a cartesian product, every
possible combination of both:
Most likely, this is not what you had in mind. Since there are two tables in the from_list, one join predicated
is needed:
|3 |tres |3 |three |
---------------------------------------------------------
2 rows selected
When you join these two tables, you get only the two rows that have the same tag:
Row one in table english and row cuatro in table spanish fall into the outer joins:
Joins
+--------------+
left outer ---> | one 1 |
| +--------------+
+--> | two | 2 : dos |
inner join | | | : |
+--> | three | 3 : tres |
Page 166 of 262
+--------|- - -+ |
| 4 cuatro| <--- right outer
+--------------+
You can select outer join rows by using not exists. This query fetches the row in english that is not in
spanish (the left outer join):
This query fetches the row in spanish that is not in english (the right outer join):
-------------------------------------------
|English |tag |Spanish |
-------------------------------------------
|one |1 |--no entry-- |
|two |2 |dos |
|three |3 |tres |
|--no entry-- |4 |cuatro |
-------------------------------------------
4 rows selected
If you think this is a lot of trouble to retrieve outer join data, there's another way to handle known joins in
Illustra that will factor in outer join data. Keep reading.
We start by creating the two tables like this and inserting data:
* update english
set sname = (select unique ref(s1) from spanish s1
where english.tag = s1.tag);
3 rows updated
Notice that the select from english returned the oid reference to spanish. You can dereference that oid as
follows:
We can also take it the opposite way by updating the spanish_t type and spanish table as follows:
* update spanish
set ename = (select unique ref(e1) from english e1
where spanish.tag = e1.tag);
3 rows updated
Realize that if new rows are inserted into either table, the reference must be set in the tables that references
it.
PL/SQL is Oracle's Procedural Language extension to SQL. PL/SQL's language syntax, structure and data
types are similar to that of ADA. The PL/SQL language includes object oriented programming techniques
such as encapsulation, function overloading, information hiding (all but inheritance). PL/SQL is commonly
used to write data-centric programs to manipulate data in an Oracle database.
Page 170 of 262
34. Should one use PL/SQL or Java to code procedures and triggers?
Internally the Oracle database supports two procedural languages, namely PL/SQL and Java. This leads to
questions like "Which of the two is the best?" and "Will Oracle ever desupport PL/SQL in favour of Java?".
Many Oracle applications are based on PL/SQL and it would be difficult of Oracle to ever desupport PL/SQL.
In fact, all indications are that PL/SQL still has a bright future ahead of it. Many enhancements are still being
made to PL/SQL. For example, Oracle 9iDB supports native compilation of Pl/SQL code to binaries.
PL/SQL and Java appeal to different people in different job roles. The following table briefly describes the
difference between these two language environments:
PL/SQL:
Java:
Code for stored procedures, functions and packages is stored in the Oracle Data Dictionary. One can detect
code changes by looking at the LAST_DDL_TIME column in the USER_OBJECTS dictionary view.
Example:
SELECT OBJECT_NAME,
TO_CHAR(CREATED, 'DD-Mon-RR HH24:MI') CREATE_TIME,
TO_CHAR(LAST_DDL_TIME, 'DD-Mon-RR HH24:MI') MOD_TIME,
STATUS
FROM USER_OBJECTS
WHERE LAST_DDL_TIME > '&CHECK_FROM_DATE';
36. How can one search PL/SQL code for a string/ key value?
The following query is handy if you want to know where a certain table, field or expression is referenced in
your PL/SQL source code.
One can build a history of PL/SQL code changes by setting up an AFTER CREATE schema (or database)
level trigger (available from Oracle 8.1.7). This way one can easily revert to previous code should someone
make any catastrophic changes. Look at this example:
PL/SQL V2.2, available with Oracle7.2, implements a binary wrapper for PL/SQL programs to protect the
source code.
This is done via a standalone utility that transforms the PL/SQL source code into portable binary object code
(somewhat larger than the original). This way you can distribute software without having to worry about
exposing your proprietary algorithms and methods. SQL*Plus and SQL*DBA will still understand and know
how to execute such scripts. Just be careful, there is no "decode" command available.
The syntax is:
One can use the DBMS_OUTPUT package to write information to an output buffer. This buffer can be
displayed on the screen from SQL*Plus if you issue the SET SERVEROUTPUT ON; command. For
example:
Page 172 of 262
set serveroutput on
begin
dbms_output.put_line('Look Ma, I can print from PL/SQL!!!');
end;
/
DBMS_OUTPUT is useful for debugging PL/SQL programs. However, if you print too much, the output buffer
will overflow. In that case, set the buffer size to a larger value, eg.: set serveroutput on size 200000
If you forget to set serveroutput on type SET SERVEROUTPUT ON once you remember, and then EXEC
NULL;. If you haven't cleared the DBMS_OUTPUT buffer with the disable or enable procedure, SQL*Plus
will display the entire contents of the buffer when it executes this dummy PL/SQL block.
Included in Oracle 7.3 is an UTL_FILE package that can read and write operating system files. The directory
you intend writing to has to be in your INIT.ORA file (see UTL_FILE_DIR=... parameter). Before Oracle 7.3
the only means of writing a file was to use DBMS_OUTPUT with the SQL*Plus SPOOL command.
DECLARE
fileHandler UTL_FILE.FILE_TYPE;
BEGIN
fileHandler := UTL_FILE.FOPEN('/tmp', 'myfile', 'w');
UTL_FILE.FCLOSE(fileHandler);
EXCEPTION
WHEN utl_file.invalid_path THEN
raise_application_error(-20000, 'ERROR: Invalid path for
file or path not in INIT.ORA.');
END;
/
One can call DDL statements like CREATE, DROP, TRUNCATE, etc. from PL/SQL by using the "EXECUTE
IMMEDATE" statement. Users running Oracle versions below 8i can look at the DBMS_SQL package (see
FAQ about Dynamic SQL).
begin
EXECUTE IMMEDIATE 'CREATE TABLE X(A DATE)';
Page 173 of 262
end;
NOTE: The DDL statement in quotes should not be terminated with a semicolon.
Starting from Oracle8i one can use the "EXECUTE IMMEDIATE" statement to execute dynamic SQL and
PL/SQL statements (statements created at run-time). Look at these examples. Note that statements are
NOT terminated by semicolons:
-- Returning a cursor...
sql_stmt := 'SELECT * FROM emp WHERE empno = :id';
EXECUTE IMMEDIATE sql_stmt INTO emp_rec USING emp_id;
One can also use the older DBMS_SQL package (V2.1 and above) to execute dynamic statements. Look at
these examples:
DBMS_SQL.V7);
DBMS_SQL.BIND_VARIABLE(v_cursor, ':x', no);
DBMS_SQL.DEFINE_COLUMN_CHAR(v_cursor, 1, v_dname, 20);
v_rows := DBMS_SQL.EXECUTE(v_cursor);
loop
if DBMS_SQL.FETCH_ROWS(v_cursor) = 0 then
exit;
end if;
DBMS_SQL.COLUMN_VALUE_CHAR(v_cursor, 1, v_dname);
DBMS_OUTPUT.PUT_LINE('Deptartment name: '||v_dname);
end loop;
DBMS_SQL.CLOSE_CURSOR(v_cursor);
EXCEPTION
when others then
DBMS_SQL.CLOSE_CURSOR(v_cursor);
raise_application_error(-20000, 'Unknown Exception Raised:
'||sqlcode||' '||sqlerrm);
END;
/
The %TYPE and %ROWTYPE constructs provide data independence, reduces maintenance costs, and
allows programs to adapt as the database changes to meet new business needs.
%ROWTYPE is used to declare a record with the same types as found in the specified database table, view
or cursor. Example:
DECLARE
v_EmpRecord emp%ROWTYPE;
%TYPE is used to declare a field with the same type as that of a specified table's column. Example:
DECLARE
v_EmpNo emp.empno%TYPE;
NULL is neither equal to NULL, nor it is not equal to NULL. Any comparison to NULL is evaluated to NULL.
Look at this code example to convince yourself.
declare
Page 175 of 262
a number := NULL;
b number := NULL;
begin
if a=b then
dbms_output.put_line('True, NULL = NULL');
elsif a<>b then
dbms_output.put_line('False, NULL <> NULL');
else
dbms_output.put_line('Undefined NULL is neither = nor <> to
NULL');
end if;
end;
45. How does one get the value of a sequence into a PL/SQL variable?
As you might know, one cannot use sequences directly from PL/SQL. Oracle (for some silly reason)
prohibits this:
i := sq_sequence.NEXTVAL;
However, one can use embedded SQL statements to obtain sequence values:
There is no direct way to execute operating system commands from PL/SQL in Oracle7. However, one can
write an external program (using one of the precompiler languages, OCI or Perl with Oracle access
modules) to act as a listener on a database pipe (SYS.DBMS_PIPE). Your PL/SQL program then put
requests to run commands in the pipe, the listener picks it up and run the requests. Results are passed back
on a different database pipe. For an Pro*C example, see chapter 8 of the Oracle Application Developers
Guide.
In Oracle8 one can call external 3GL code in a dynamically linked library (DLL or shared object). One just
write a library in C/ C++ to do whatever is required. Defining this C/C++ function to PL/SQL makes it
executable. Look at this External Procedure example.
DECLARE
CURSOR dept_cur IS
SELECT deptno
FROM dept
ORDER BY deptno;
-- Employee cursor all employees for a dept number
Page 176 of 262
48. How often should one COMMIT in a PL/SQL loop? / What is the best commit strategy?
Contrary to popular believe, one should COMMIT less frequently within a PL/SQL loop to prevent ORA-1555
(Snapshot too old) errors. The higher the frequency of commit, the sooner the extents in the rollback
segments will be cleared for new transactions, causing ORA-1555 errors.
To fix this problem one can easily rewrite code like this:
... to ...
If you still get ORA-1555 errors, contact your DBA to increase the rollback segments.
NOTE: Although fetching across COMMITs work with Oracle, is not supported by the ANSI standard.
49. I can SELECT from SQL*Plus but not from PL/SQL. What is wrong?
Page 177 of 262
PL/SQL respect object privileges given directly to the user, but does not observe privileges given through
roles. The consequence is that a SQL statement can work in SQL*Plus, but will give an error in PL/SQL.
Choose one of the following solutions:
Grant direct access on the tables to your user. Do not use roles!
GRANT select ON scott.emp TO my_user;
Define your procedures with invoker rights (Oracle 8i and higher);
Move all the tables to one user/schema.
"Mutating" means "changing". A mutating table is a table that is currently being modified by an update,
delete, or insert statement. When a trigger tries to reference a table that is in state of flux (being changed), it
is considered "mutating" and raises an error since Oracle should not return data that has not yet reached its
final state.
Another way this error can occur is if the trigger has statements to change the primary, foreign or unique key
columns of the table off which it fires. If you must have triggers on tables that have referential constraints,
the workaround is to enforce the referential integrity through triggers as well.
A row-level trigger cannot query or modify a mutating table. (Of course, NEW and OLD still can be
accessed by the trigger) .
A statement-level trigger cannot query or modify a mutating table if the trigger is fired as the result
of a CASCADE delete.
The only way the same object type can be referenced between two databases is via a database link. Note
that it is not enough to just use the same type definitions. Look at this example:
In earlier releases of Oracle it was better to put as much code as possible in procedures rather than triggers.
At that stage procedures executed faster than triggers as triggers had to be re-compiled every time before
executed (unless cached). In more recent releases both triggers and procedures are compiled when created
(stored p-code) and one can add as much code as one likes in either procedures or triggers.
No. Unlike Oracle Forms, SQL*Plus does not have an embedded PL/SQL engine. Thus, all your PL/SQL
code is sent directly to the database engine for execution. This makes it much more efficient as SQL
statements are not stripped off and sent to the database individually.
SQL*Loader is a bulk loader utility used for moving data from external files into the Oracle database. Its
syntax is similar to that of the DB2 Load utility, but comes with more options. SQL*Loader supports various
load formats, selective loading, and multi-table loads.
55. Can one load variable and fix length data records?
Yes, look at the following control file examples. In the first we will load delimited data (variable length):
LOAD DATA
INFILE *
INTO TABLE load_delimited_data
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
( data1,
data2
)
BEGINDATA
11111,AAAAAAAAAA
22222,"A,B,C,D,"
If you need to load positional data (fixed length), look at the following control file example:
LOAD DATA
INFILE *
INTO TABLE load_positional_data
( data1 POSITION(1:5),
data2 POSITION(6:15)
)
BEGINDATA
11111AAAAAAAAAA
Page 179 of 262
22222BBBBBBBBBB
Use the "SKIP n" keyword, where n = number of logical rows to skip. Look at this example:
LOAD DATA
INFILE *
INTO TABLE load_positional_data
SKIP 5
( data1 POSITION(1:5),
data2 POSITION(6:15)
)
BEGINDATA
11111AAAAAAAAAA
22222BBBBBBBBBB
Data can be modified as it loads into the Oracle Database. Note that this only applies for the conventional
load path and not for direct path loads.
LOAD DATA
INFILE *
INTO TABLE modified_data
( rec_no "my_db_sequence.nextval",
region CONSTANT '31',
time_loaded "to_char(SYSDATE, 'HH24:MI')",
data1 POSITION(1:5) ":data1/100",
data2 POSITION(6:15) "upper(:data2)",
data3 POSITION(16:22)"to_date(:data3, 'YYMMDD')"
)
BEGINDATA
11111AAAAAAAAAA991201
22222BBBBBBBBBB990112
LOAD DATA
INFILE 'mail_orders.txt'
BADFILE 'bad_orders.txt'
APPEND
INTO TABLE mailing_list
Page 180 of 262
LOAD DATA
INFILE *
REPLACE
INTO TABLE emp
WHEN empno != ' '
( empno POSITION(1:4) INTEGER EXTERNAL,
ename POSITION(6:15) CHAR,
deptno POSITION(17:18) CHAR,
mgr POSITION(20:23) INTEGER EXTERNAL
)
INTO TABLE proj
WHEN projno != ' '
( projno POSITION(25:27) INTEGER EXTERNAL,
empno POSITION(1:4) INTEGER EXTERNAL
)
59. Can one selectively load only the records that one need?
Look at this example, (01) is the first character, (30:37) are characters 30 to 37:
LOAD DATA
INFILE 'mydata.dat' BADFILE 'mydata.bad' DISCARDFILE 'mydata.dis'
APPEND
INTO TABLE my_selective_table
Page 181 of 262
WHEN (01) <> 'H' and (01) <> 'T' and (30:37) = '19991217'
(
region CONSTANT '31',
service_key POSITION(01:11) INTEGER EXTERNAL,
call_b_no POSITION(12:29) CHAR
)
One cannot use POSTION(x:y) with delimited data. Luckily, from Oracle 8i one can specify FILLER columns.
FILLER columns are used to skip columns/fields in the load file, ignoring fields that one does not want. Look
at this example:
LOAD DATA
TRUNCATE INTO TABLE T1
FIELDS TERMINATED BY ','
( field1,
field2 FILLER,
field3
)
One can create one logical record from multiple physical records using one of the following two clauses:
CONCATENATE: - use when SQL*Loader should combine the same number of physical records
together to form one logical record.
CONTINUEIF - use if a condition indicates that multiple records should be treated as one. Eg. by
having a '#' character in column 1.
62. How can get SQL*Loader to COMMIT only at the end of the load file?
One cannot, but by setting the ROWS= parameter to a large value, committing can be reduced. Make sure
you have big rollback segments ready when you use a high value for ROWS=.
SQL*Plus is a command line SQL and PL/SQL language interface and reporting tool that ships with the
Oracle Database Client and Server. It can be used interactively or driven from scripts. SQL*Plus is
frequently used by DBAs and Developers to interact with the Oracle database.
SQL*Plus's predecessor was called UFI (User Friendly Interface). UFI was included in the first releases of
Oracle, its interface was extremely primitive and anything but user friendly.
AFIEDT.BUF is the SQL*Plus default edit save file. When you issue the command "ed" or "edit" without
arguments, the last SQL or PL/SQL command will be saved to a file called AFIEDT.BUF and opened in the
default editor.
In the prehistoric days when SQL*Plus was called UFI, the file name was "ufiedt.buf", short for UFI editing
buffer.
When new features were added to UFI, it was the initially named Advanced UFI and the filename was
changed to "aufiedt.buf" and then to "afiedt.buf". They presumably needed to keep the name short for
compatibility with some of the odd operating systems that Oracle supported in those days.
The name "Advanced UFI" was never used officially, as the name was changed to SQL*Plus before this
version was released.
You can overwrite the default edit save file name like this:
A single @ symbol runs the script in your current directory, or one specified with a full or relative path, or one
that is found in you SQLPATH or ORACLE_PATH.
@@ will start a sqlplus script that is in the same directory as the script that called it (relative to the directory
of the current script). This is normally used for nested command files.
"&" is used to create a temporary substitution variable and will prompt you for a value every time it is
referenced.
"&&" is used to create a permanent substitution variable as with the DEFINE command and the
OLD_VALUE or NEW_VALUE clauses of a COLUMN statement. Once you have entered a value it will use
that value every time the variable is referenced.
Page 183 of 262
SET ECHO OFF NEWPAGE 0 SPACE 0 PAGESIZE 0 FEED OFF HEAD OFF TRIMSPOOL
ON
One can pass operating system variables to sqlplus using this syntax:
Parameter var1 will be mapped to SQL*Plus variable &1, var2 to &2, etc. Look at this example:
69. Can one copy tables with LONG columns from one database to another?
About the fastest way of copying data between databases and schemas are by using the SQL*Plus COPY
statement. Look at this example:
70. What is a mutating table error and how can you get around it?
Page 184 of 262
This happens with triggers. It occurs because the trigger is trying to update a row it is currently using. The
usual fix involves either use of views or temporary tables so the database is selecting from one while
updating the other.
71. What packages (if any) has Oracle provided for use by developers?
Oracle provides the DBMS_ series of packages. There are many which developers should be aware of such
as DBMS_SQL, DBMS_PIPE, DBMS_TRANSACTION, DBMS_LOCK, DBMS_ALERT, DBMS_OUTPUT,
DBMS_JOB, DBMS_UTILITY, DBMS_DDL, UTL_FILE. If they can mention a few of these and describe how
they used them, even better. If they include the SQL routines provided by Oracle, great, but not really what
was asked.
74. In what order should a open/fetch/loop set of commands in a PL/SQL block be implemented if you use
the %NOTFOUND cursor variable in the exit when statement? Why?
OPEN then FETCH then LOOP followed by the exit when. If not specified in this order will result in the final
return being done twice because of the way the %NOTFOUND is handled by PL/SQL.
75. What are SQLCODE and SQLERRM and why are they important for PL/SQL developers?
SQLCODE returns the value of the error number for the last error encountered. The SQLERRM returns the
actual error message for the last error encountered. They can be used in exception handling to report, or,
store in an error log table, the error that occurred in the code. These are especially useful for the WHEN
OTHERS exception.
76. How can you find within a PL/SQL block, if a cursor is open?
Use the %ISOPEN cursor status variable.
“select * from dba_tables where owner=&owner_name;” . Use of double ampersands tells SQLPLUS to
resubstitute the value for each subsequent use of the variable, a single ampersand will cause a reprompt for
the value unless an ACCEPT statement is used to get the value from the user.
80. You want to include a carriage return/linefeed in your output from a SQL script, how can you do this?
The best method is to use the CHR() function (CHR(10) is a return/linefeed) and the concatenation function
“||”. Another method, although it is hard to document and isn’t always portable is to use the return/linefeed as
a part of a quoted string.
82. How do you execute a host operating system command from within SQL?
By use of the exclamation point “!” (in UNIX and some other OS) or the HOST (HO) command.
83. You want to use SQL to build SQL, what is this called and give an example
This is called dynamic SQL. An example would be:
set lines 90 pages 0 termout off feedback off verify off spool drop_all.sql
select ‘drop user ‘||username||’ cascade;’ from dba_users
where username not in (“SYS’,’SYSTEM’); spool off
Essentially you are looking to see that they know to include a command (in this case DROP
USER...CASCADE;) and that you need to concatenate using the ‘||’ the values selected from the database.
85. You want to group the following set of select returns, what can you group on?
Max(sum_of_cost), min(sum_of_cost), count(item_no), item_no
Expected answer: The only column that can be grouped on is the “item_no” column, the rest have aggregate
functions associated with them.
86. What special Oracle feature allows you to specify how the cost based system treats a SQL statement?
The COST based system allows the use of HINTs to control the optimizer path selection. If they can give
some example hints such as FIRST ROWS, ALL ROWS, USING INDEX, STAR, even better.
87. You want to determine the location of identical rows in a table before attempting to place a unique index
on the table, how can this be done?
Oracle tables always have one guaranteed unique column, the rowid column. If you use a min/max function
against your rowid and then select against the proposed primary key you can squeeze out the rowids of the
duplicate rows pretty quick. For example:
In the situation where multiple columns make up the proposed key, they must all be used in the where
clause.
89. You are joining a local and a remote table, the network manager complains about the traffic involved,
how can you reduce the network traffic?
Push the processing of the remote data to the remote instance by using a view to pre-select the information
for the join. This will result in only the data required for the join being sent across.
92. How do you set the number of lines on a page of output? The width?
The SET command in SQLPLUS is used to control the number of lines generated per page and the width of
those lines, for example SET PAGESIZE 60 LINESIZE 80 will generate reports that are 60 lines long with a
line width of 80 characters. The PAGESIZE and LINESIZE options can be shortened to PAGES and LINES.
94. How do you prevent Oracle from giving you informational messages during and after a SQL statement
execution?
The SET options FEEDBACK and VERIFY can be set to OFF.
95. How do you generate file output from SQL?
Expected answer: By use of the SPOOL command
96. What are Background processes in Oracle and what are they.
There are basically 9 Processes but in a general system we need to mention the first five background
processes. They do the house keeping activities for the Oracle and are common in any system.
The various background processes in oracle are
Data Base Writer Writes Modified blocks from Database buffer cache to Data Files. This is required since
the data is not written whenever a transaction is committed.
b) LogWriter (LGWR):
LogWriter writes the redo log entries to disk. Redo Log data is generated in redo log buffer of SGA. As
transactions commit and log buffer fills, LGWR writes log entries into a online redo log file.
The System Monitor performs instance recovery at instance startup. This is useful for recovery from system
failure
The Process Monitor performs process recovery when user Process fails. Pmon Clears and Frees resources
that process was using.
e) Checkpoint (CKPT):
At Specified times, all modified database buffers in SGA are written to data files by DBWR at Checkpoints
and Updating all data files and control files of database to indicate the most recent checkpoint
f) Archieves (ARCH) ::
The Archiver copies online redo log files to archival storal when they are busy.
g) Recoveror (RECO) ::
The Recoveror is used to resolve the distributed transaction in network
h) Dispatcher (Dnnn) ::
The Dispatcher is useful in Multi Threaded Architecture
i) Lckn ::
We can have upto 10 lock processes for inter instance locking in parallel sql.
c) Session Control
Used to control the properties of current session enabling and disabling roles and changing .e.g :: Alter
Statements, Set Role
e) Embedded Sql
Incorporate DDL,DML and T.C.S in Programming Language.e.g:: Using the Sql Statements in
languages such as 'C', Open,Fetch, execute and close
b. Rollback
A transaction that retracts any of the changes resulting from SQL statements in
Transaction.
c. SavePoint
For long transactions that contain many SQL statements, intermediate markers or
savepoints are declared. Savepoints can be used to divide a transaction into smaller
points.
d. Rolling Forward ::
Process of applying redo log during recovery is called rolling forward.
e. Cursor
A cursor is a handle (name or a pointer) for the memory associated with a specific
statement. A cursor is basically an area allocated by Oracle for executing the Sql
Statement. Oracle uses an implicit cursor statement for Single row query and Uses
Explicit cursor for a multi row query.
f. System Global Area(SGA) ::
The SGA is a shared memory region allocated by the Oracle that contains Data and
control information for one Oracle Instance.It consists of Database Buffer Cache and
Redo log Buffer.
Packages Provide a method of encapsulating and storing related procedures, functions, variables and other
Package Contents
Database Triggers are Procedures that are automatically executed as a result of insert in, update
to, or delete from table. Database triggers have the values old and new to denote the old value in the table
before it is deleted and the new indicated the new value that will be used. DT are useful for implementing
complex business rules which cannot be enforced using the integrity rules. We can have the trigger as
Before trigger or After Trigger and at Statement or Row level.
e.g. operations insert, update ,delete
3 before ,after 3*2.A total of 6 combinations
At statement level(once for the trigger) or row level( for every execution ) 6 * 2 A total of 12.
Page 189 of 262
Thus a total of 12 combinations are there and the restriction of usage of 12 triggers has been lifted from
Oracle 7.3 Onwards.
Stored Procedures
Stored Procedures are Procedures that are stored in Compiled form in the database. The
advantage of using the stored procedures is that many users can use the same procedure in compiled and
ready to use format.
102. How many Integrity Rules are there and what are they
There are Three Integrity Rules. They are as follows ::
a) Entity Integrity Rule ::
The Entity Integrity Rule enforces that the Primary key cannot be Null.
b) Foreign Key Integrity Rule ::
The FKIR denotes that the relationship between the foreign key and the primary key has to be
enforced.When there is data in Child Tables the Master tables cannot be deleted.
c) Business Integrity Rules ::
The Third Intigrity rule is about the complex business processes which cannot be implemented
by the above 2 rules.
103. What are the Various Master and Detail Relation ships.
By setting the Optimize_Tp= No, Oracle Forms assigns seperate cursor only for each query
SELECT statement. All other SQL statements reuse the cursor.
f45run module = my_firstform userid = scott/tiger optimize_Tp = No
We can use the same lov for 2 columns by passing the return values in global values and using the global
values in the code
109. How many minimum groups are required for a matrix report
The minimum number of groups in matrix report are 4
The static lov contains the predetermined values while the dynamic lov contains values that come at run
time
Snapshots are mirror or replicas of tables. Views are built using the columns from one or more tables. The
Single Table View can be updated but the view with multi table cannot be updated
Oracle does implement the OOPS concepts. The best example is the Property Classes. We can categorise
the properties by setting the visual attributes and then attach the property classes for the objects. OOPS
supports the concepts of objects and classes and we can consider the peroperty classes as classes and the
items as objects
113. What is the difference between candidate key, unique key and primary key
Candidate keys are the columns in the table that could be the primary keys and the primary key is the key
that has been selected to identify the rows. Unique key is also useful for identifying the distinct rows in the
table.
a) Exclusive
The exclusive lock is useful for locking the row when an insert,update or delete is being done.This lock
should not be applied when we do only select from the row.
b) Share lock
We can do the table as Share_Lock as many share_locks can be put on the same resource.
The table space is useful for storing the data in the database. When a database is created two table spaces
are created.
Page 191 of 262
Data Files
Every Oracle Data Base has one or more physical data files. They store the data for the database. Every
data file is associated with only one database. Once the Data file is created the size cannot change. To
increase the size of the database to store more data we have to add data file.
Parameter Files
Parameter file is needed to start an instance. A parameter file contains the list of instance configuration
parameters e.g.::
db_block_buffers = 500
db_name = ORA7
db_domain = u.s.acme lang
Control Files
Control files record the physical structure of the data files and redo log files
They contain the Db name, name and location of dbs, data files ,redo log files and time stamp.
Data Block
One Data Block correspond to specific number of physical database space
Extent
Extent is the number of specific number of contigious data blocks.
Segments
Set of Extents allocated for Extents. There are three types of Segments
Data Segment
Non Clustered Table has data segment data of every table is stored in cluster data segment
Index Segment
Each Index has index segment that stores data
Two Phase commit is used in distributed data base systems. This is useful to maintain the integrity of the
database so that all the users see the same values. It contains DML statements or Remote Procedural calls
that reference a remote object. There are basically 2 phases in a 2 phase commit.
b) 2 Normal Form
A table is said to be in 2nd Normal Form when all the candidate keys are dependant on the primary key
125. What is the Difference between a post query and a pre query
A post query will fire for every row that is fetched but the pre query will fire only once.
139. create a syquence, open a new session and execute first statement as select
sequence. currval from dual; what will happene?
Ans:It will give an error. First time we have to fire next val & then only we can use currval.
140. I have t1 table in scott .. and same i have scott1 schema with same name... i grant
Page 194 of 262
select on scott1.t1 to scott, now i create a synonym for scott1.t1, what happenes when
it is created. will it give runtime error or error while creating synonym?
Ans: This will give an error, Same name can not be used
5. Buffer catche size is now dynamic (upto 4 different sizes can be specified for buffers)
end user presses a key to enter or edit the value in a text item.
Delayed:- Form Builder locks the row only while it posts the
transaction to the database, not while the end user is editing the
record. Form Builder prevents the commit action from processing if
values of the fields in the block have changed when the user causes a
commit action.
Method Overloading
151. Can we use label for anonymous PL/SQL block?
156. What is the difference between REF Cursor & PL/SQL Table.
Ans: REF Cursor is like Pointer whereas PL/SQL Table is like ARRAY.
REF Cursor can pass to a procedure/function as a parameter directly whereas in PL/SQL table one record
has to be passed each time.
Page 196 of 262
Collections work like the arrays found in most third-generation programming languages. However,
collections can have only one dimension and must be indexed by integers. You can define collection types
in a package, then use them programmatically in your applications. Also, you can pass collections as
parameters. So, you can use them to move columns of data into and out of database tables or between
client-side applications and stored subprograms. In addition, collections can store instances of an object
type and (except for index-by tables) can be attributes of an object type.
Oracle Forms is a 4GL Rapid Application Development (RAD) environment. Forms Builder is used to create
applications to enter, access, change, or delete data from Oracle (and other) databases. The Forms
Runtime environment is required to execute compiled Forms modules. Forms can also be deployed across
the Web using the Oracle Internet Application Server (iAS) Forms Services.
Oracle Forms is part of the Oracle Internet Developer Suite (iDS). It was previously called
SQL*Forms.
FMX files are operating system dependent. On the other hand, FMB's are not. So, you have to regenerate
them when ever you change the operating system or the Forms version.
3. How does one iterate through items and records in a specified block?
One can use NEXT_FIELD to iterate (loop) through items in a specific block and NEXT_RECORD to iterate
through records in a block. Code example:
OriPos := TO_NUMBER(:System.Trigger_Record);
First_Record;
LOOP
-- do processing
IF (:System.Last_Record = 'TRUE') THEN
Go_Record(OriPos);
EXIT;
ELSE
Next_Record;
END IF;
END LOOP
Page 197 of 262
The first thing that the user sees when using runform is the Oracle logon prompt asking them for their
username, password, and database to connect to. You can bypass this screen or customise it by displaying
your own logon screen. Eg:
ON-LOGIN
declare
uname varchar2(10);
pass varchar2(10);
begin
uname := 'username';
pass :='password';
logon(uname, pass||'@connect_database');
end;
On MS-Windows, Forms run inside a Windows Multiple-Document Interface (MDI) window. You can use
SET_WINDOW_PROPERTY on the window called FORMS_MDI_WINDOW to resize this MDI (or any other
named) window. Examples:
set_window_property(FORMS_MDI_WINDOW,WINDOW_STATE, MINIMIZE);
set_window_property(FORMS_MDI_WINDOW, POSITION, 7, 15);
set_window_property('my_window_name', WINDOW_STATE, MAXIMIZE);
One can either set the message level using the system variable SYSTEM.MESSAGE_LEVEL or trap the
errors using the ON-ERROR or ON-MESSAGE triggers.
DDL (Data Definition Language) commands like CREATE, DROP and ALTER are not directly supported from
Forms because your Forms are not suppose to manipulate the database structure.
However, you can use the FORMS_DDL built-in to execute DDL statements. Eg:
FORMS_DDL can also be used to create dynamic SQL statements at runtime. The FORMS_SUCCESS
built-in can be used to determine if the last executed built-in was successful.
Yes, use the FORMS_DDL built-in or call the DBMS_SQL database package from Forms. Eg:
FORMS_DDL('INSERT INTO X VALUES (' || col_list || ')');
Just note that FORMS_DDL will force an implicit COMMIT and may de-synchronize the Oracle Forms
COMMIT mechanism.
How to get around the "can't use a restricted built-in in built-in XXX" message:
1. Create a TIMER at the point where you want the navigation to occur.
DECLARE
tm_name VARCHAR2(20);
BEGIN
tm_name := Get_Application_Property(TIMER_NAME);
IF tm_name = 'TIMER_X' THEN
Go_Item('ITEM_X');
END IF;
END;
Dirty but effective (didn't Oracle promise to fix this feature?).
The SET_APPLICATION_PROPERTY build-in in Oracle Forms allow one to change the mouse pointer. The
following cursor styles are supported: DEFAULT, BUSY, HELP, INSERTION and CROSSHAIR.
Eg: SET_APPLICATION_PROPERTY(CURSOR_STYLE, BUSY);
Regardless of whether you call the MESSAGE() built-in with ACKNOWLEDGE, NO_ACKNOWLEDGE, or
with no mode specification at all, your message may or may not be displayed. This is because messages
are displayed asynchronously. To display messages immediately, use the SYNCHRONIZE build-in:
message('...'); synchronize;
This can also be used to execute a query while the user is looking at the results of a previous query.
From Forms V4.5, SQL*Menu is fully integrated into Oracle Forms. Application menus can be added to your
application by creating Menu Modules (*.MMB) and generate it to Menu Module Executables (*.MMX).
Create a new block, let's name it "TOOLBAR" and a canvas named "C_TOOLBAR" (for ilustration
purposes). Put some iconic buttons on your canvas. Use the following properties for these buttons:
Enabled: True
Navigable: False
Mouse Navigate: False
Now set the "Canvas Type" in the canvas property palette to "Horizontal Toolbar" and the "Form Horizontal
Toolbar Canvas" in the module property palette to your canvas name (C_TOOLBAR in our case).
The Microsoft Help Compiler does not ship with Designer/2000 or Developer/2000, but you can download it
from here:
Help Compiler - FTP Sites
Note: Designer/2000 includes a Help Generator that can generate source files for the Help Compiler.
OS files can be read/written from Forms using the TEXT_IO package in Forms. The TEXT_IO package has
a datatype FILE_HANDLE. It also has procedures FCLOSE, GET_LINE, NEW_LINE, PUT, PUT_LINE &
PUTF and a function FOPEN. Example:
DECLARE
file1 TEXT_IO.FILE_TYPE;
file2 TEXT_IO.FILE_TYPE;
str VARCHAR2(80);
BEGIN=
file1 := TEXT_IO.FOPEN( 'input.txt','r' );
file2 := TEXT_IO.FOPEN( 'output.txt', 'w' );
TEXT_IO.GET_LINE( file1, str );
TEXT_IO.PUT_LINE( file2, str );
TEXT_IO.FCLOSE( file1 );
TEXT_IO.FCLOSE( file2 );
END;
@echo off
@echo. +----------------------------------------------------------
@echo. | FMXGNALL.BAT
@echo. +----------------------------------------------------------
@echo. |
@echo. | Create runtime FMXs from source FMBs
@echo. | Will convert ALL of the fmbs in the current direcotry
Page 200 of 262
@echo.
@echo Done!!! Remember to move the FMX files into your runtime
directory.
@echo.
:END
You need to design your form on your workstation. FTP or copy the Forms's FMB file to the Unix box. If you
generate for a terminal environment (character based),
the syntax is:
f45gen USERID=userid/passwd@db_name
MODULE_TYPE=FORM MODULE=module_name
If you want to generate a Library file, replace FORM with LIBRARY. Use f45genm to generate your form in a
Motif environment. Use the "f45run" command to run your form.
Most Unix, MVS and VMS users do not like Forms 4.5/ 5.0/ 6.0 for a couple of reasons:
You need to design on a PC and frequently get compatibility problems (font scaling, etc);
Forms 4.5 is no improvement for Forms 3.0 terminal users at all, rather it is a step backwards;
Forms 4.5 uses too much memory and executables are about 400% larger than for its 3.0 counter
part;
Page 201 of 262
The largest Oracle Forms customers still runs on Forms V3.0 and will rather throw out Oracle than
to convert to Forms 4.5.
I think Oracle should bring SQL*Forms v3.0 back for terminal users. They could rename the product to
Oracle Forms for Terminals, or something.
Oracle Forms and Reports Services is a component of the Oracle Internet Application Server (9iAS) that
enables programmers to deploy Oracle Forms and Oracle Reports across the Web. Forms and Reports
services as previously known as WebForms and WebReports. Some people also refer to it as the Forms
and Reports Server.
With Oracle's Forms and Reports Services one can web-enable existing Oracle Developer (Forms and
Reports) applications without changing any application code.
WebForms consist of a Forms client (downloadable Java applet) and FormsServer (Java NCA Cartridge).
WebForms can be centrally deployed and managed and provides a nice thin client implementation.
2. What Web Servers can be used with the Forms and Reports Services?
The Oracle HTTP Server (Apache Web server) is installed with the Forms and Reports Services. However,
any web server that supports CGI (Common Gateway Interfaces) can be used.
3. How does one start and stop the Forms and Reports Services?
Please note that the Forms Services will be running directly after installing the product. Use the following
command to start and stop the Forms Services:
$ORACLE_HOME/6iserver/forms60_server start
$ORACLE_HOME/6iserver/forms60_server stop
Restrictions:
The statement you pass to FORMS_DDL may not contain bind variable references in the string, but the values of
bind variables can be concatenated into the string before passing the result to FORMS_DDL.
6) What are the types of triggers and how the sequence of firing in text item
6) Triggers can be classified as Key Triggers, Mouse Triggers, Navigational Triggers.
Mouse Triggers: Mouse Triggers are fired as a result of the mouse navigation.
e.g. When-mouse-button-pressed, when-mouse-doubleclicked, etc
The Difference between Key-next and Post-Text is an very important question. The key-next is fired as a result of the
key action while the post text is fired as a result of the mouse movement. Key next will not fire unless there is a key
event.
The sequence of firing in a text item are as follows ::
a) pre - text
b) when new item
c) key-next
d) when validate
e) post text
By simply changing the definition of a property class, you can change the definition of all objects that inherit
properties from that class.
Yes . All type of triggers .
9) If you have property class attached to an item and you have same trigger written for the item * Which will
fire first?
9) Item level trigger fires, If item level trigger fires, property level trigger won't fire. Triggers at the lowest level are
always given the first preference. The item level trigger fires first and then the block and then the Form level trigger.
10) What are record groups? * Can record groups created at run-time?
10) A record group is an internal Oracle Forms data structure that has a column/row framework similar to a database
table. However, unlike database tables, record groups are separate objects that belong to the form module in which
they are defined. A record group can have an unlimited number of columns of type CHAR, LONG, NUMBER, or
DATE provided that the total number of columns does not exceed 64K. Record group column names cannot exceed
30 characters. Programmatically, record groups can be used whenever the functionality offered by a two-dimensional
array of multiple data types is desirable.
12) Can a button have icon and label at the same time?
12) -NO
19) Can you pass values to-and-fro from foreign function? how?
19) Yes, You obtain a return value from a foreign function by assigning the return value to an Oracle Forms variable
or item. Make sure that the Oracle Forms variable or item is the same data type as the return value from the foreign
function.
After assigning an Oracle Forms variable or item value to a PL/SQL variable, pass the PL/SQL variable as a
parameter value in the PL/SQL interface of the foreign function. The PL/SQL variable that is passed as a parameter
must be a valid PL/SQL data type; it must also be the appropriate parameter type as defined in the PL/SQL interface.
Locking mode:
Specifies when Oracle Forms should attempt to obtain database locks on rows that correspond to queried records in
the form.
a) immediate b) delayed
28) What are savepoint mode and cursor mode properties ? level?
28) Specifies whether Oracle Forms should issue savepoints during a session. This property is included primarily for
applications that will run against non-ORACLE data sources. For applications that will run against ORACLE, use the
default setting.
Cursor mode - define cursor state across transaction
Open/close.
GUI
Reports 2.5
13) How many types of columns are there and what are they
5) Formula columns:
For doing mathematical calculations and returning one value
Summary Columns:
For doing summary calculations such as summations etc.
Place holder Columns:
These columns are useful for storing the value in a variable
18) What are the minimum number of groups required for a matrix report
8) The minimum of groups required for a matrix report are 4
7. I switched the page size to 11x8.5, but the printer still prints in portrait.
Even though you set the page size in the report properties, there is a another variable in the system
parameters section under the data model in the object navigator called orientation. This sets the printer
orientation. Oracle starts by setting it to "default" which means that no matter how you set the page size, the
user's default printer setup will be used. You can also set it to either "Landscape" or "Portrait" to force the
printer orientation no matter what the user has set as default. These sorts of picky, minor details are the
ones which are invariably forgotten when you are designing your report and are the reason I created our two
report templates, reptmp_p and reptmp_l (portrait and landscape). For anyone who wants a consistent look
in their reports I strongly recommend building a similar pair to save yourself an ulcer, unless you actually like
starting from scratch every time!?!
8. I moved this field into that repeating frame, but I'm still getting a "frequency below it's group" error.
Moving fields around does not change what enclosing object is considered it's parent group. Oracle carefully
remembers what repeating frame a field was originally placed in and assigns that as it's parent. If you then
reference a column further down the line of the query structure it will return that error. If you are not exactly
sure which repeating frame a field belongs to, try dragging it out of all of them. Whichever frame will not
Page 207 of 262
allow it to escape is it's parent. To change a field's parent, first click on the lock button on the speed button
bar. It should now look like an unlocked padlock. Now all of the fields on the layout can be repositioned
regardless of their original parent items. When you are satisfied with the repositioning click the lock button
again to lock the layout. Oracle will parse the layout and assumes that any item fully enclosed in a repeating
frame is a child object of that frame. This can be confirmed again by trying to drag an object out of it's
parent. (Cntrl - Z or edit..undo will put it back where it came from)
Sometimes, for unknown and mysterious reasons, this method does not work. The alternative in this case is
to highlight the field (or fields), cut it (cntrl-x), and then paste it into the desired frame. The paste does not
initially set it into the right frame, but if you drag and drop it there before clicking on any other objects, and
then click on something else, Oracle will usually figure what your intent was and assign the object(s) as a
child of that frame. This is my preferred method of changing a field's parent as it works much more
consistently then the unlock/lock method. One note though, if you are reassigning a group of fields, make
sure the frame you are going to move them into is large enough to accept the whole group at once before
you do the cut/paste. If you do the paste and then try to grow the frame to fit, you will have to cut and paste
again. Once you de-select an object that has just been pasted, Oracle will assign it as a child of whatever it
is in at the time.
If this technique also fails, you are probably going to have to delete and then recreate the objects within the
desired frame. If the object has triggers attached, save yourself some typing by creating the new object in
the right frame, copying over the trigger code, and then deleting the old object
9. I must put a repeating frame around these fields. How do I do this easily?
Well congratulations, you have just discovered one of the main reasons why good planning goes a long way.
Oracle looks at the layout as a sort of layered inheritance model such that anything created on top of and
completely inside another object is by definition a child of that object. Creation order is there for critical to the
layout process. This means that placing a repeating frame on top of a field but larger than that field fails the
ownership criteria. At best, if the new frame is fully enclosed within the same higher level frame as the field
then the two will be considered sibling children of the higher level frame.
From this point you have two options. First, you can place the new repeating frame in the correct place and
then use the techniques shown above in the "I moved this field but am still getting a frequency error" to
reassign the fields into the new frame. There is also a second choice (which can also be used as a solution
to the above). Go ahead and draw the new frame around the fields you want to have placed in it. Now if you
try to click on one of the fields you will not be able to as they are fully covered by the new frame. Now go to
the "Arrange" menu. You will find the options Send to back, bring to front, move forwards, move backwards.
These are used to alter an object position in the Reports layer ordering. You use the "send backwards"
option to move the frame backwards until all of the fields have popped to the front and are now enclosed in
it. Oracle reassigns the new repeating frame as each object's parent as they pop to the front.
Note that you can only move an object back and forth amongst it's siblings. You cannot set it back below it's
parent, nor in front of it's children. This means that once an object has popped to the front and had a
reassignment of parent, you cannot move it back using these tools.
10. Why does part of a row sometimes get shifted to the next page, but not all of it?
This is due to the way the scan works when Oracle is parsing the layout. If the tops of all the fields in a row
are aligned and the fields are all of the same height and font, they should all stay together. I suspect,
however, that Reports bases it's decision on the printed size rather than the field size you define to
determine which objects are too large and must be shifted to the next page. This means that even if you set
two fields top-aligned with the same height and font but one of them is bolded, the bolded field could get
shifted to the next page due to it's bigger footprint. The solution is to put the whole row into a regular frame
which is page protected.
The print condition type First, All, All but first, Last, All but last refer to the frequency with which you want to
appear based upon the setting of the print condition object. A print condition object of Enclosing Object is
Page 208 of 262
whichever object encloses the current object (could be the parent or a frame within the parent), while
Anchoring Object is the parent object (unless you have explicitly anchored the object in which case it is the
object to which it is anchored). The key here is that this is about the pages on which the Print Condition
Object appears, not the current object. Oracle views First as the first page on which any part of the Print
Condition Object is printed, likewise Last is the last page on which any part of the Print Condition Object is
printed. For objects inside a repeating frame, this condition is re-evaluated for each instance of the frame.
As an example, assume we have created a field inside a repeating frame with Print Condition Object set to
'anchoring object', and Print Condition Type set to 'All But First'. On every instance of that repeating frame
which is printed entirely within a single page, our object will not print. However, if an instance of that frame
spans more than one page then our object will print on the second and every subsequent page that this
instance of the repeating frame spans.
For most objects you will not have to play with this print condition setting as the default setting is pretty good
at determining what pages to print on, even though it only chooses between 'first' and 'last'. Only such things
as heading objects you want reprinted on multiple pages are normally candidates for fooling around with this
setting.
1. How do I create a truly dynamic 'where' condition which the user can input on the parameter form
for my select statement?
While setting a simple parameter for use in defining the select statement, such as a date, bill_period_id etc.
is simple, there are times when you may wish to allow a user to add any "where" statement they wish.
However, if you create a varchar user variable and try to reference it as an SQL condition ( e.g. Select * from
account where :usercondition) you will get an error. The secret is that the variable must be initialized to a
valid SQL condition before the Data Model will accept it. This is done in the "Initial Value" spot on the
variable's properties form. The usual default is "1 = 1" which simply means all rows meeting whatever other
conditions are included in the select statement will pass this condition if the user does not change it in the
parameter form.
12. How do I change a user parameter at runtime from a layout object trigger?
Quite simply, you can't. Once the Before Report trigger has fired, Reports locks down the user parameters
until the report is finished. Oh, I know you can put a statement into a layout trigger at design time and the
compiler will accept it, but the moment you run the report you will get a nasty error and the report will die.
Why they couldn't catch those problems at compile time I have no idea, except that it probably uses the
same PL/SQL compiler as Forms which uses that same syntax for the perfectly acceptable function of
changing field values.
That being said, there is valid technique to mimic having a user variable which can be changed over the
course of the report execution. What you have to do is create a PL/SQL package that contains a variable as
well as the functions to read and write to that variable. Since variables inside a package are both local to
that package and persistent over the duration of the run, you use this to save and change your variable
value. I know that this seems like overkill, but it is the most efficient way of handling an issue that is very
rarely encountered. As you can probably guess, this technique is a last resort to finding an SQL work around
if one exists.
13. How do I set the initial values of parameters for the parameter form at runtime?
This is what the Before Form trigger is primarily used for. Even if you have used a select statement to create
a lookup list for the parameter, this statement is fully parsed before the parameter form is opened. Simply
setting the parameter to a given value in the Before Form trigger will select that option as the default value
displayed to the user. For example, assume you have a parameter called p_input_date which is intended to
hold an invoice date. The following example will select the most recent invoice date as the default, and note
that it properly handles exceptions to ensure that the report does not arbitrarily die if this default setting fails.
Note also that like all report triggers, it must return a true or false value.
select max(bill_period_end_date + 1)
into :p_input_date
from billing_period
where bill_period_end_date <= (select trunc(sysdate) from dual);
return (TRUE);
exception
when others then
:p_input_date := null;
return true;
end;
14. Why can't I highlight a bunch of fields and change all their format masks or print conditions at once?
You can. If you highlight a bunch of objects and then right click and select "properties..", Oracle gives you a
stacked set of the individual properties forms for each of the selected objects. While this may be useful for
some things, it requires changing values individually for each object. However, instead you can select the
group of fields and then select "Common properties" from the "Tools" menu which will allow you to set the
format mask , print conditions etc. for the whole set of objects at once.
Triggers are intended to simply provide a true or false return value to determine whether an object should be
printed. It is generally not allowed to change any values held in the cursor, make changes to the database,
or change the value of it's objects value. That being said, there is a highly unpublicized method of doing just
that using the SRW.Set_Field_Char procedure. The syntax is SRW.Set_Field_char(0,) and the output of the
object that the current trigger is attached to will be replaced by . There are also SRW.set_fileld_num, and
SRW.set_field_date for numeric or date fields.
While these options do work, they should only be used if a suitable NVL or DECODE statement in the
original query is not possible as they are much, much slower to run. Also, note that this change of value only
applies to the formatted output. It does not change the value held in the cursor and so can not be used for
evaluating summary totals.
Record group types There are three types of record groups: query record groups, non-query record groups,
and static record groups.
Query record group A query record group is a record group that has an associated SELECT
statement. The columns in a query record group derive their default names, data types, and lengths from
the database columns referenced in the SELECT statement. The records in a query record group are the
rows retrieved by the query associated with that record group. Query record groups can be created and
modified at design time or at runtime.
Non-query record group A non-query record group is a group that does not have an associated query, but
whose structure and values can be modified programmatically at runtime. Non-query record groups can be
created and modified only at runtime.
Static record group A static record group is not associated with a query; instead, you define its structure and
row values at design time, and they remain fixed at runtime. Static record groups can be created and
modified only at design time.
You do not specify the record group type explicitly. The type is implied by when the record group is created
(at design time or at runtime) and by how the group is defined.
Table Type nodes Table types appear within the Types node in the Object Navigator. A table type node
represents a type created by the SQL statement, CREATE TYPE AS TABLE. The table type is displayed in
the Object Navigator as:
Page 210 of 262
The following SQL statements create the object type emp_typ and the table type emp_tbl.
CREATE TYPE emp_typ AS OBJECT
(ename VARCHAR2(30), esalary NUMBER(5,2),
MEMBER PROCEDURE raise(amount NUMBER),
MEMBER FUNCTION get_salary RETURN NUMBER,
MAP MEMBER FUNCTION compare RETURN NUMBER);
CREATE TYPE emp_tbl AS TABLE OF emp_typ;
Oracle8 is an object-relational database management system, which means you can define additional kinds
of data-specifying both the data and the ways of operating on it-and use these types within the relational
model.
There are two categories of user-defined datatypes: object types and collection types. User-defined
datatypes use the built-in datatypes (such as CHAR, VARCHAR2, and NUMBER) and other user-defined
datatypes as the building blocks for datatypes that model the structure and behavior of data in applications.
An object type serves as a template for objects. An object type specifies the elements (or attributes) that
make up a structured data unit like a purchase order. Some attributes, such as the list of line items, may be
other structured data units. An object type also specifies the operations (or methods) you can perform on
the data unit, such as determining the total value of a purchase order.
Collection types describe data units that are made up of an indefinite number of elements, all of the same
datatype. The collection types are varying array types and table types.
A varying array type specifies a data unit called VARRAY, which is an ordered set of data elements all of the
same datatype. The number of elements in a VARRAY (or its size) is variable. However, you must specify a
maximum size when you declare the varying array type.
A table type specifies a data unit called a nested table, which is an unordered set of data elements all of the
same datatype. A nested table has a single column, and the type of that column is a built-in type or an
object type.
Matrix reports A matrix (crosstab) report contains one row of labels, one column of labels, and information in
a grid format that is related to the row and column labels. A distinguishing feature of matrix reports is that
the number of columns is not known until the data is fetched from the database.
To create a matrix report, you need at least four groups: one group must be a cross-product group, two of
the groups must be within the cross-product group to furnish the "labels," and at least one group must
provide the information to fill the cells. The groups can belong to a single query or to multiple queries.
Bookmark Go to End
Frequently Asked Questions (FAQ)
Oracle Payables
Invoice Processing
Release 10.7, 11.0 and 11.5(11i)
The information in this document has been reviewed and is current as of 22-Nov-2002.
Instructions for the reader: This FAQ document identifies the most frequently reported how-to questions
relating to the Oracle Payables Invoice Processing. The articles below do not include bugs/patches or
troubleshooting as these are addressed in great detail in the notes referenced at the bottom of this
document.
Page 211 of 262
FAQ Summary
1. iSupplier Invoices: How do I use iSupplier Portal Invoice Entry?
2. Match/Hold: How do I remove a Final Matching hold so that I can pay the invoice?
3. Match: What do the codes in the Final Match flag mean and what does Final Match do?
4. Invoice Type: What is a "Mixed" invoice and how do I enter one?
5. Tax: How do I create a Withholding Tax Invoice?
6. Interest: How do I create Interest Invoices?
7. Match: How to Match Invoices to Purchase Orders?
8. New Features: What new Invoice Processing features have been introduced since 11i was
released?
9. Approval/Validation: What happened to the Invoice Approval option after applying 11i.AP.I?
10. Supplier Import: Is it possible to import suppliers from my legacy system into Oracle Payables?
11. Requester: In 11i, what is the "Requestor" field used for on the Invoice Workbench?
12. Setup: What articles, white papers, or manuals should I read for more information on Expense
Report Import (Invoice Import in 10.7 and 11.0)?
13. Keywords: What are the MetaLink keywords I should use when searching for Invoice Processing
Issues?
14. Patches: List of One-Off Patch available for Invoice Processing
FAQ Details
The Invoice document is used to bill the Buyer for services and/or products delivered by the Seller.
Credit is the means by which we are able to obtain immediate benefit of goods or services upon the promise
of payment at a future date.
Credit memo: When you want to adjust an invoice, document issued by the vendor to record an adjustment
against an invoice.
Description The supplier presents to the customer for the ordered or delivered, received or consumed
goods or services a detailed invoice. The customer disputes the invoice and works with
supplier to resolve issue. If any discrepancy is found, the customer shall start the process to
treat incorrect invoices. Once Supplier and Customer agree upon the nature of the dispute,
Supplier issues a credit memo to correct the problem. Buyer receives credit memo,
reconciles with order and contract information and issues payment.
Negative = Credit
Positive = Debit
Verify its correctness.
o Note the reason for the credit if it is not clear on the credit memo itself
o Indicate the account and center where the credit should be applied.
o Forward all credits to Accounts Payable immediately so that the credit can be applied to
your cost center and deducted from the next payment to the vendor. DO NOT HOLD
CREDITS IN THE DEPARTMENT FOR ANY REASON.
o Accounts Payable will apply the credit against any open invoices in the system.
o Make a copy for your records.
Debit memo: Negative amount invoice created by us and sent to supplier to notifying him about the credit we
are recording.
AP is divided in to 2 workbenches.
Invoice workbench
Payable workbench
Page 212 of 262
We usually enter supplier invoice either in Invoice workbench or quick invoice window.
Invoice workbench:
Contains:
Invoice Batch window
Invoice window
Distribution window
Other associated windows
When to use:
Incase of complex invoices or invoices that requires online validation.
When an invoice requires immediate action.
Expanse Reports:
Invoice Creation:
Invoice Distributions:
Account: Company have different COA so follow that hierarchy for each set of item.
Accounting Date: Date when we are planning to post it to GL ie. GL Date.
Payments:
Record: Manual payments (checks,wire) which are made out of OP and they will be recorded in Op and
update the invoice for which you have paid.
Computer Generated:
Combined:
Page 213 of 262
Payment:
Lookup: It is a predefined values used as a LOV. In some fields we select a value from a predefined set of
values, In some cases we have defined them in the setup windows such as supplier name,payment terms or
tax codes. Other predefined set of values are Lookup codes.
Navigation:
SetupLookups
Distribution Sets:
It is a predefined set of distribution for a repeated or a same set of distribution form a supplier. We can either
link it to supplier site or we can link it to the invoice.
There are 2 types of distribution sets.
Full Distribution Sets: We will define % amount of the invoice to each distribution line and sum of all lines
must be either 0 or 100. We can enter –ve % values.
Skeleton Distribution Sets: Leave the % field as 0 so that at the time of invoice creation you ca enter amount
in different distribution lines.
Purchase document:
Use Bank window to define internal bank branch from which you disburse payments. For each bank account
we can define payment document for check, EFT, EDI or wire transfer and other payment methods.
A:After you match an invoice to a Purchase Order, you can look at the
AP_INVOICE_DISTRIBUTIONS_ALL table and observe different codes in the FINAL_MATCH
FLAG column. The FINAL_MATCH_FLAG has the following QuickCodes:
N No The PO shipment line has not been matched.
Y Yes The PO shipment line has been matched, AND one of the invoices for this PO has
been final matched. When a PO is final matched to an invoice, all other invoices for that
PO are updated, too. So you cannot tell from this flag, which invoice was final matched. D
Done The PO shipment line is closed. You cannot invoice this distribution line.
Note: When you match an invoice to a PO, nothing special happens. But when you final match an
invoice to a PO, that means you can never match another invoice to that PO. The PO lines that
have been matched are closed.
[top]
Q4. Invoice Type: What is a "Mixed" Invoice and how do I enter one?
A:Mixed Invoices are invoices or credit/debit memos for which you can perform both positive and
negative matching to purchase orders and to other invoices.
For example, you can enter an invoice for -$100 with Invoice Type Mixed. You can match to an
invoice for $-200, and match to a purchase order for $100.
To enter a Mixed invoice:
1. Enter the invoice or credit/debit memo in the Invoices Summary, and enter Mixed as the invoice
Type. You can enter either a positive or negative invoice amount.
2. Match to purchase orders, and/or invoices.
[top]
Q5. How do I create a Withholding Tax invoice?
A:After you apply withholding tax to an invoice, you can optionally create invoices to remit withheld
tax to the tax authority.
Payables can automatically create withholding tax invoices, or you can perform this task manually.
If you chose to automatically create withholding tax invoices, you must choose whether to do this
during Approval or during payment processing. Indicate this choice in the Withholding Tax region of
the Payables Options window. See: Withholding Tax Payables Options.
If you choose to create withholding tax invoice manually, create an invoice for each Withholding Tax
type invoice distribution on an invoice. Create the invoice for the tax authority supplier and site
assigned to the Withholding Tax type tax name and for the amount of the Withholding Tax type
invoice distribution.
Please see Note 198307.1 and the 11i Payables User Guide (pages 10-26 through 10-55), for more
information on Withholding Tax invoice creation.
[top]
Q6. Interest: How do I create Interest Invoices?
A:Chapter 10 of the 11i Payables User Guide discusses setting up and using Interest Invoices. Also
see Note 198308.1 for more information on creating Interest Invoices including coverage of the
following Interest Invoice sub-topics:
1) Setting steps that must be completed
2) Minimum Interest amounts
3) Expense GL Account to be charged for interest expense
4) Liability GL Account to be charged for interest expense
5) Automatic Interest
6) Invoice Due Date calculations
7) Interest amount calculations
[top]
Q7. Match: How do I Match Invoices to Purchase Orders?
Page 215 of 262
A: Note 198535.1 provides detailed instructions for matching purchase orders to Invoices. This
content is presented in the form of a white paper in PDF format. The 11i Payables User Guide
(pages 4-68 through 4-82) also provides a thorough overview of the Invoice Matching process.
[top]
Q8. New Features: What new Invoice Processing features have been introduced since 11i was
released?
A: For a complete description of new features released in Mini-Packs "A" through "I" please review
Note 166537.1. Beginning with 11i.AP.J and continuing with Family Packs C+, Payables will deliver
new feature descriptions in the "About" document for each Mini/Family Pack. Please see the
11i.AP.J About document for more details.
AP support strongly recommends that you install the corresponding documentation patch for
Mini/Family Packs that you apply. These documentation patches contain the most up to date On-
Line Help files with instructions on how to use or implement the new functionality introduced by the
patch.
Note: 11i.AP.J was the last Payables Mini-Pack for 11i. After Mini-Pack J, Payables will deliver all
11i consolidated patches in Family Packs. 11i.AP.J will contain the same code release as Financials
Family Pack C.
New Invoice Processing Features by Mini/Family Pack:
AP.J / Family Pack C: Interest Expense Proration, Enhanced Matching Controls for Finally Closed
Purchase Orders, Payment Batch Enhancements, Invoice Approval Workflow Enhancements,
iSupplier Portal Invoices.
AP.I: View Currency Details, Primary Pay Site, Invoice Approval Workflow
AP.E: Negative Supplier Balance Report, Employee Update Program
AP.A: Automatic Creation of Debit Memo from RTS, Input Tax Groups
[top]
Q9. Approval/Validation: What happened to the Invoice Approval option after applying 11i.AP.I?
A: In Mini-pack I, Payables is adding a new workflow named Invoice Approval Workflow that asks
approvers to review invoice details, and confirm online whether the invoice is accurate and should
be paid. The Payables Approval program has been renamed to prevent confusion with the new
workflow and to more accurately reflect its function. For a complete list of the renamed programs
see Note: 179837.1.
[top]
Q10. Supplier Import: Is it possible to import suppliers from my legacy system into Oracle
Payables?
A: This functionality does not currently exist however enhancement an enhancement request has
been logged. Please follow bug 94383 for up to date status on this request.
[top]
Q11. Requestor: In 11i, what is the "Requestor" field used for on the Invoice Workbench?
A: This field represents the person who requested the goods or services that are on the invoice. If
you use Invoice Approval Workflow, then you can define rules that use this value to generate a
hierarchical list of approvers for the invoice.
[top]
Q12. Setup: What articles, white papers, or manuals should I read for more information on Invoice
Processing?
A: Please see the Metalink Note 207154.1 for the most current version of the 11i Payables Users
Guide.
[top]
Q13. What are the MetaLink keywords I should use when searching for Invoice Processing Issues
on MetaLink?
A: PAYABLES; APXINWKB; INVOICE
[top]
Page 216 of 262
Q14. Patches: List off One-Off Patch available for Invoice Processing
A: A listing of the most frequently requested one-off patches for Invoice processing can be found in
Note 202259.1.
[top]
IMPORTANT: If you did not find the information you were searching for, please review the following Payables
Invoice Processing information:
Payables Invoice Processing Current Issues
Payables Invoice Processing One-Off Patches
Payables Invoice Processing Setup and Usage Instructions
Payables Invoice Processing Frequently Asked Questions (FAQ's)
Payables Invoice Processing Troubleshooting Guide
Copyright © 2002 Oracle Corporation. All rights reserved. Oracle is a registered trademark of Oracle
Corporation. Various product and service names referenced herein may be trademarks of Oracle
Corporation. All other product and service names mentioned may be trademarks of their respective owners.
Disclaimer: This document is provided for information purposes only and the contents hereof are subject to
change without notice. Oracle Corporation does not warrant that this document is error-free, nor does it
provide any other warranties or conditions, whether expressed orally or implied in law, including implied
warranties and conditions of merchantability or fitness for a particular purpose. Oracle Corporation
specifically disclaims any liability with respect to this document and no contractual obligations are formed
either directly or indirectly by this document. This document may not be reproduced or transmitted in any
form or by any means, electronic or mechanical, for any purpose, without the prior written permission of
Oracle Corporation. .
Bookmark Go to End
Patches Guide
Oracle Payables
Payables Open Interface and
Expense Report Import (formerly Invoice Import)
Versions 10.7, 11.0 and 11.5(11i)
The information in this document has been reviewed and is current as of 26-Nov-2002
Instructions for the reader: This Patches Guide provides information for one-off patches, which may or may
not be included in recent Mini-Packs or Family Packs. Click on the patch number to view specific details
about the patch. Before application of the patches listed in this document, please be sure you have reviewed
the information provided in the Payables Critical Patch Note.
9) Patch 2478471 11i Import fails with APP-SQLAP-10916: apiicv/5:ORA-01426: numeric overflow. ONE-
OFF FOR BASE BUG 2478471.
APXIIMPT: Open Interface Import
1) Patch 2227273 11i Open Interface Import report shows duplicate invoices with the same invoice number.
ONE-OFF FOR BASE BUG 2204291.
2) Patch 2361634 11i APXIIMPT report truncates report header information. ONE-OFF FOR BASE BUG
2303767.
3) Patch 2017593 11i APXIIMPT does not reject invoices matched to PO�s with wrong PO lines. ONE-OFF
FOR BASE BUG 1927155.
4) Patch 2538037 11i Open Interface gives IPV line on invs uploaded w/o unit. ONE-OFF FOR BASE BUG
2531058.
5) Patch 2442692 11i Invoices not imported even if the dist code concat is valid. ONE-OFF FOR BASE BUG
2429210.
Patch Details
APXXTR: Expense Report Import (Invoice Import in 10.7 and 11.0)
1) 2385900 Import fails with APP-SQLAP-10916: APIDBI/1:ORA-01458: invalid length inside variable
character string
Download Patch 2385900
Problems fixed by this patch: Import fails with: Getting invoice id � Validating holds � Inserting invoice
records � APP-SQLAP-10916: apidbi/1:ORA-01458: invalid length inside variable character string �
Cleaning allocated memory
See Alert 201119.1 for more details on this bug
Files fixed and version: apidib.lpc 115.10.1156.5
Prerequisite Patch Level: 11i.AP.I
Fixed in Mini-Pack or Family Pack:N/A
[top]
2) 2222486 Import Errors with Signal 11
Download Patch 2222486
Problems fixed by this patch When a prepayment is applied to an expense report and the expense report is
imported, the import program fails with signal 11 error.This is bug 2021385
Prerequisite Patch Level: 11i.AP.F
Fixed in Mini-Pack or Family Pack:11i.AP.I
[top]
3) 2277148 Import fails with APP-SQLAP-10916: apiisp/01:ORA-01458: invalid length inside variable
character string
Download Patch 2277148
Problems fixed by this patch After applying 11i.AP.H, the following errors were reported:Import fails with
APP-SQLAP-10916: apiisp/01:ORA-1458: invalid length inside variable character string. Program was
terminated by signal 11.
Files fixed and version: apiisp.lpc 115.11
Prerequisite Patch Level: 11i.AP.H
Fixed in Mini-Pack or Family Pack: N/A
[top]
4) 1858968 Imported Expense Reports Created with site of Office instead of Home
Download Patch 1858968
Problems fixed by this patch: Imported Expense Reports Created with site of Office Instead of Home.More
information can be found in Note 156780.1
Files fixed and version: apxgii.lpc 115.16
Prerequisite Patch Level: 11i.AP.E
Fixed in Mini-Pack or Family Pack: 11i.AP.G
[top]
5) 2199740 Import Fails with APP-SQLAP-10916: APIICB/1:ORA 01722: Invalid Number
Download Patch 2199740
Problems fixed by this patch: Payables Invoice Import fails with the error APP-SQLAP-10916: APIICB/1:ORA
01722: Invalid Number.
Files fixed and version: apiicb.lpc 115.8
Prerequisite Patch Level:N/A
Fixed in Mini-Pack or Family Pack:11i.AP.I
[top]
6) 2606164 Expense Report Import truncates invoice amount in the Payment Schedules for expense reports
Page 218 of 262
IMPORTANT:If you did not find the information you were searching for, please review the following Payables
Import documents
Payables Invoice Import Current Issues
Payables Invoice Import One-Off Patches
Payables Invoice Import Setup and Usage Instructions
Payables Expense Report Import Troubleshooting Guide
Payables Open Interface Import Troubleshooting Guide
Payables Expense Report Import Frequently Asked Questions (FAQ�s)
Payables Open Interface Import Frequently Asked Questions (FAQ�s)
Copyright © 2002 Oracle Corporation. All rights reserved.
Oracle is a registered trademark of Oracle Corporation. Various product and service names referenced
herein may be trademarks of Oracle Corporation. All other product and service names mentioned may be
trademarks of their respective owners.
Disclaimer:
This document is provided for information purposes only and the contents hereof are subject to change
without notice. Oracle Corporation does not warrant that this document is error-free, nor does it provide any
other warranties or conditions, whether expressed orally or implied in law, including implied warranties and
conditions of merchantability or fitness for a particular purpose. Oracle Corporation specifically disclaims any
liability with respect to this document and no contractual obligations are formed either directly or indirectly by
this document. This document may not be reproduced or transmitted in any form or by any means,
electronic or mechanical, for any purpose, without the prior written permission of Oracle Corporation.. .
Bookmark Go to End
BookmarkGo to End
Troubleshooting Guide
Oracle Payables
Payables Transfer to GL (Posting)
Versions 10.7, 11.0, 11.5 (11i)
The information in this document has been reviewed and is current as of 25-Nov-2002.
Instructions for the reader: This Troubleshooting document identifies the most frequently reported setup and
usage problems/errors relating to Payables Transfer to General Ledger. The articles below do not include
bugs/patches or FAQ's, as these are addressed in great detail in the notes referenced at the bottom of this
document.
Troubleshooting Summary
1. Script: Diagnostic Script that identifies transactions that are not transferred to GL (Release 11.5).
2. Script: Diagnostic Script that identifies problems with the transfer to GL process for one transaction
or and entire Payables Transfer to GL run (Release 11.5).
3. Script: Diagnostic Script that identifies problems posting a transaction (Release 10.7 and 11.0).
4. Script: Diagnostice Script that provides table level details of invoices and payments.
Page 220 of 262
5. Prob: There are payments and/or invoices that are not posting to GL, and you believe they should
post.
6. Prob: Payables Transfer to GL was successful, but the Journal Import is not importing the data into
GL
7. Error: UNDIST error on some payments when using Automatic Offsets (Release 10.7 and 11.0).
8. Prob: RATE exception when running Payables Transfer to GL.
9. Prob: PERIOD exception when transferring tax lines created from Multiple Tax Distributions (MTD)
to GL (Release 10.7 and 11.0).
10. Error: Payables Transfer to GL errors with APP-10962 APJEL/35 ORA-1458 (Release 10.7 and
11.0).
11. Prob: Payables Transfer to GL program / Accounts Payable Journal Entry Audit Report shows No
data found (Release 10.7 and 11.0).
12. Prob: Payables Transfer to General Ledger Report shows No Data Exists (Release 11i)
13. Prob: The Journal Import process fails when kicked off by the Payables Transfer to GL process
(Release 10.7 and 11.0).
14. Error: Closing the AP Accounting Period errors with APP-SQLAP-10741 (Release 11.5).
15. Error: Payables Transfer to General Ledger Report lists some of the transactions as "Accounting
entries have accounting entry creation errors" (Release 115).
16. Error: Payables Transfer to GL exits with Status 1 ORA-20100 File o0000004.tmp creation for
FND_FILE failed ORA-06512 (Release 11.5).
17. Prob: What articles, white papers, or manuals should I read for more information on Payables
Transfer to GL?
18. Prob: What are the MetaLink keywords I should use when searching for Payables Transfer to GL
on MetaLink?
19. Prob: The problems and solutions listed in this guide do not answer my question.
Troubleshooting Details
1. Script: Diagnostic Script that helps to identify transactions that are not transferred to GL for
Release 11.5.
Sol: The Closing script is available for download in Note 180165.1. This script lists any
transactions that are not accounted or transferred to GL in an html file in portrait format.
[top]
2. Script: Diagnostic Script that identifies problems with the Transfer to GL process for one
transaction or an entire Payables Transfer to GL run for Release 11.5.
Sol: The Posting Diagnostic script is available for download in Note 185935.1. This script
lists any problems when running the Payables Transfer to GL process in an html file in
portrait format.
[top]
3. Script: Diagnostic Script that identifies problems posting a transaction for Release 10.7 and 11.0.
Sol: The scripts found in Note 105929.1 help identify problems when posting a
transaction.
[top]
4. Script: Diagnostice Script that provides table level details of invoices and payments.
Sol: Please download and run the APLIST script from Note 148388.1 to see detailed data
information on an invoice or payment.
[top]
5. Prob: There are payments and/or invoices that are not posting to GL and you believe they should
post.
Sol: Ensure invoices are ready to post. An invoice must be approved and/or have no
posting holds in order to be selected for posting. To ensure that your invoices are ready to
post, you should run autoapproval and review the hold reports.
Page 221 of 262
8. Prob: You get a RATE exception when running Payables Transfer to GL.
Sol: Populate the Daily Rates table for the exchange date, run Autorate, if needed, and
rerun the Payables Transfer to General Ledger program.
[top]
9. Prob: You get a PERIOD exception when transferring tax lines created from Multiple Tax
Distributions (MTD) to GL in Release 10.7 and 11.0.
Sol: Please see Note 94351.1
[top]
10. Error: In Release 10.7 and 11.0, Payables Transfer to General Ledger process errors with APP-
10962 APJEL/35 ORA-1458 value larger than specified precision allows for this column.
Sol: Please review Note 96119.1
[top]
11. Prob: In Release 10.7 and 11.0, Payables Transfer to GL program shows 'No data found'.
Sol: Please review Note 1067036.6 and Note 1012060.7
Page 222 of 262
[top]
12. Prob: In Release11.5, the Payables Transfer to General Ledger Report shows No Data Exists.
Sol: Please review Note 188354.1
[top]
13. Prob: In Release 10.7 and 11.0, the Journal Import process fails when kicked off by the
Payables Transfer to GL process.
Sol: Please review Note 107272.1
[top]
14. Prob: Closing the AP Accounting Period in Release 11.5 errors with APP-SQLAP-10741: This
period cannot be closed because there are accounting entries that have not been transferred to
GL.
Sol: Please review Note 174638.1
[top]
15. Error: In Release 11.5, Payables Transfer to General Ledger Report lists some of the
transactions as "Accounting entries have accounting entry creation errors".
Sol: There is a problem with the accounting for your transactions. Please either review
Payables Accounting Process Report, which is created when the Payables Accounting
Process is run, or the run the Payables Accounting Entries Report to determine which
transactions are accounted incorrectly. For additional help troubleshooting accounting
problems, please review Note 131225.1
[top]
top
16. Error: In Release 11.5, Payables Transfer to GL exits with Status 1 ORA-20100 File
o0000004.tmp creation for FND_FILE failed ORA-06512.
Sol: Please review Note 141706.1
[top]
17. What articles, white papers, or manuals should I read for more information on Payables
Transfer to GL?
Sol: Please review the Transfer to GL (Posting) Setup and Usage Guide for a complete list
of available documents.
[top]
18. Prob: What are the MetaLink keywords I should use when searching for Payables transfer to
GL on MetaLink?
Sol: APPPST, APGLTRANS, APXGLTRN, POST, POSTING, GLLEZL, GENERAL
LEDGER, GL
[top]
19. Prob: The problems and solutions listed in this guide do not answer my question.
Sol: If the Troubleshooting list for Payables Transfer to GL does not answer your question,
please click here to log an iTar.
[top]
IMPORTANT: If you did not find the information you were searching for, please review the following Payables
Transfer to GL (Posting) documents Payables Transfer to GL (Posting) Current Issues Payables Transfer to
Page 223 of 262
GL (Posting) One-Off Patches Payables Transfer to GL (Posting) Setup and Usage Instructions Payables
Transfer to GL (Posting) Troubleshooting Guide Payables Transfer to GL (Posting) Frequently Asked
Questions (FAQ�s) 10.7 and 11.0 Payables Transfer to GL (Posting) Frequently Asked Questions (FAQ's)
11i
Oracle Payables One-Off Patch Directory
http://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=177591.1
http://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=177591.1Copyright © 2002 Oracle
Corporation. All rights reserved.
Oracle is a registered trademark of Oracle Corporation. Various product and service names referenced
herein may be trademarks of Oracle Corporation. All other product and service names mentioned may be
trademarks of their respective owners.
Disclaimer: This document is provided for information purposes only and the contents
hereof are subject to change without notice. Oracle Corporation does not warrant that this
document is error-free, nor does it provide any other warranties or conditions, whether
expressed orally or implied in law, including implied warranties and conditions of
merchantability or fitness for a particular purpose. Oracle Corporation specifically
disclaims any liability with respect to this document and no contractual obligations are
formed either directly or indirectly by this document. This document may not be
reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the prior written permission of Oracle Corporation.
..
Bookmark Go to End
BookmarkGo to End
Troubleshooting Guide
Oracle Payables
Payables Transfer to GL (Posting)
Versions 10.7, 11.0, 11.5 (11i)
The information in this document has been reviewed and is current as of 25-Nov-2002.
Instructions for the reader: This Troubleshooting document identifies the most frequently reported setup and
usage problems/errors relating to Payables Transfer to General Ledger. The articles below do not include
bugs/patches or FAQ's, as these are addressed in great detail in the notes referenced at the bottom of this
document.
Troubleshooting Summary
1. Script: Diagnostic Script that identifies transactions that are not transferred to GL (Release 11.5).
2. Script: Diagnostic Script that identifies problems with the transfer to GL process for one transaction
or and entire Payables Transfer to GL run (Release 11.5).
3. Script: Diagnostic Script that identifies problems posting a transaction (Release 10.7 and 11.0).
4. Script: Diagnostice Script that provides table level details of invoices and payments.
5. Prob: There are payments and/or invoices that are not posting to GL, and you believe they should
post.
6. Prob: Payables Transfer to GL was successful, but the Journal Import is not importing the data into
GL
7. Error: UNDIST error on some payments when using Automatic Offsets (Release 10.7 and 11.0).
8. Prob: RATE exception when running Payables Transfer to GL.
9. Prob: PERIOD exception when transferring tax lines created from Multiple Tax Distributions (MTD)
to GL (Release 10.7 and 11.0).
10. Error: Payables Transfer to GL errors with APP-10962 APJEL/35 ORA-1458 (Release 10.7 and
11.0).
11. Prob: Payables Transfer to GL program / Accounts Payable Journal Entry Audit Report shows No
data found (Release 10.7 and 11.0).
12. Prob: Payables Transfer to General Ledger Report shows No Data Exists (Release 11i)
Page 224 of 262
13. Prob: The Journal Import process fails when kicked off by the Payables Transfer to GL process
(Release 10.7 and 11.0).
14. Error: Closing the AP Accounting Period errors with APP-SQLAP-10741 (Release 11.5).
15. Error: Payables Transfer to General Ledger Report lists some of the transactions as "Accounting
entries have accounting entry creation errors" (Release 115).
16. Error: Payables Transfer to GL exits with Status 1 ORA-20100 File o0000004.tmp creation for
FND_FILE failed ORA-06512 (Release 11.5).
17. Prob: What articles, white papers, or manuals should I read for more information on Payables
Transfer to GL?
18. Prob: What are the MetaLink keywords I should use when searching for Payables Transfer to GL
on MetaLink?
19. Prob: The problems and solutions listed in this guide do not answer my question.
Troubleshooting Details
1. Script: Diagnostic Script that helps to identify transactions that are not transferred to GL for
Release 11.5.
Sol: The Closing script is available for download in Note 180165.1. This script lists any
transactions that are not accounted or transferred to GL in an html file in portrait format.
[top]
2. Script: Diagnostic Script that identifies problems with the Transfer to GL process for one
transaction or an entire Payables Transfer to GL run for Release 11.5.
Sol: The Posting Diagnostic script is available for download in Note 185935.1. This script
lists any problems when running the Payables Transfer to GL process in an html file in
portrait format.
[top]
3. Script: Diagnostic Script that identifies problems posting a transaction for Release 10.7 and 11.0.
Sol: The scripts found in Note 105929.1 help identify problems when posting a
transaction.
[top]
4. Script: Diagnostice Script that provides table level details of invoices and payments.
Sol: Please download and run the APLIST script from Note 148388.1 to see detailed data
information on an invoice or payment.
[top]
5. Prob: There are payments and/or invoices that are not posting to GL and you believe they should
post.
Sol: Ensure invoices are ready to post. An invoice must be approved and/or have no
posting holds in order to be selected for posting. To ensure that your invoices are ready to
post, you should run autoapproval and review the hold reports.
Invoice Hold Report - displays all held invoices.
Posting Hold Report - only displays invoices with holds that prevent posting.
Matching Hold Report - only displays invoices with matching holds.
Ensure payments are made. You must insure that all your payment batches have been
completed (either confirmed or canceled). A period will not close if there are payment
batches in a status other than confirmed or canceled. If an invoice is approved but will not
pay, you should insure that the invoice is due to be paid and that the payment schedule is
not on hold.
[top]
6. Prob: Payables Transfer to GL was successful, but the Journal Import is not importing the data
into GL
Sol: Examine AP Reports for Exceptions and Correct. Transactions that were selected but
encountered some exception are not inserted into the GL_INTERFACE table nor are they
Page 225 of 262
8. Prob: You get a RATE exception when running Payables Transfer to GL.
Sol: Populate the Daily Rates table for the exchange date, run Autorate, if needed, and
rerun the Payables Transfer to General Ledger program.
[top]
9. Prob: You get a PERIOD exception when transferring tax lines created from Multiple Tax
Distributions (MTD) to GL in Release 10.7 and 11.0.
Sol: Please see Note 94351.1
[top]
10. Error: In Release 10.7 and 11.0, Payables Transfer to General Ledger process errors with APP-
10962 APJEL/35 ORA-1458 value larger than specified precision allows for this column.
Sol: Please review Note 96119.1
[top]
11. Prob: In Release 10.7 and 11.0, Payables Transfer to GL program shows 'No data found'.
Sol: Please review Note 1067036.6 and Note 1012060.7
[top]
12. Prob: In Release11.5, the Payables Transfer to General Ledger Report shows No Data Exists.
Sol: Please review Note 188354.1
[top]
13. Prob: In Release 10.7 and 11.0, the Journal Import process fails when kicked off by the
Payables Transfer to GL process.
Sol: Please review Note 107272.1
[top]
14. Prob: Closing the AP Accounting Period in Release 11.5 errors with APP-SQLAP-10741: This
Page 226 of 262
period cannot be closed because there are accounting entries that have not been transferred to
GL.
Sol: Please review Note 174638.1
[top]
15. Error: In Release 11.5, Payables Transfer to General Ledger Report lists some of the
transactions as "Accounting entries have accounting entry creation errors".
Sol: There is a problem with the accounting for your transactions. Please either review
Payables Accounting Process Report, which is created when the Payables Accounting
Process is run, or the run the Payables Accounting Entries Report to determine which
transactions are accounted incorrectly. For additional help troubleshooting accounting
problems, please review Note 131225.1
[top]
top
16. Error: In Release 11.5, Payables Transfer to GL exits with Status 1 ORA-20100 File
o0000004.tmp creation for FND_FILE failed ORA-06512.
Sol: Please review Note 141706.1
[top]
17. What articles, white papers, or manuals should I read for more information on Payables
Transfer to GL?
Sol: Please review the Transfer to GL (Posting) Setup and Usage Guide for a complete list
of available documents.
[top]
18. Prob: What are the MetaLink keywords I should use when searching for Payables transfer to
GL on MetaLink?
Sol: APPPST, APGLTRANS, APXGLTRN, POST, POSTING, GLLEZL, GENERAL
LEDGER, GL
[top]
19. Prob: The problems and solutions listed in this guide do not answer my question.
Sol: If the Troubleshooting list for Payables Transfer to GL does not answer your question,
please click here to log an iTar.
[top]
IMPORTANT: If you did not find the information you were searching for, please review the following Payables
Transfer to GL (Posting) documents Payables Transfer to GL (Posting) Current Issues Payables Transfer to
GL (Posting) One-Off Patches Payables Transfer to GL (Posting) Setup and Usage Instructions Payables
Transfer to GL (Posting) Troubleshooting Guide Payables Transfer to GL (Posting) Frequently Asked
Questions (FAQ�s) 10.7 and 11.0 Payables Transfer to GL (Posting) Frequently Asked Questions (FAQ's)
11i
Oracle Payables One-Off Patch Directory
http://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=177591.1
http://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=177591.1Copyright © 2002 Oracle
Corporation. All rights reserved.
Oracle is a registered trademark of Oracle Corporation. Various product and service names referenced
herein may be trademarks of Oracle Corporation. All other product and service names mentioned may be
trademarks of their respective owners.
Disclaimer: This document is provided for information purposes only and the contents
hereof are subject to change without notice. Oracle Corporation does not warrant that this
document is error-free, nor does it provide any other warranties or conditions, whether
Page 227 of 262
Instructions for the reader: This Current Issues Guide provides a list of recently uncovered issues. These are
typically issues arising from recent Mini-Packs/Family Packs or new features. The issues may or may not be
fixed. This document also includes the most frequently encountered bugs that do not currently have one-off
patches available.
aplist11i.sql script. These notes can�t be published externally as they contain data fix scripts.
Note:166693.1 Upgraded invoices that had been voided and reissued on same day showing on trial
balance.
Note:197629.1 Foreign currency invoices show balance of $0.01 after upgrade.
Note: 198412.1 The Liability Account CCID for the payment and the invoice in ap_ae_lines_all are different.
[top]
5. 11i Trial Balance (APXTRBAL) fails after applying AP.H (Note 200022.1)
Summary:
The Trial Balance report released with AP.H and higher fails with REP-1419: 'beforereport': PL/SQL program
aborted (Error in GET_AP_AX_TRIAL_BAL_DATA). This occurs when the report is run on an 8.1.6 version
of the database (error caused a hint in the select statement).
[top]
IMPORTANT: If you did not find the information you were searching for, please review the following Payables
Trial Balance information:
Payables Trial Balance Interim Patches [Note:200363.1]
Payables Trial Balance Setup and Usage Instructions [Note:200512.1]
Payables Trial Balance Frequently Asked Questions (FAQ's) [Note:106740.1]
Payables Trial Balance Troubleshooting Guide [Note:106744.1]
Copyright © 2003 Oracle Corporation. All rights reserved. Oracle is a registered trademark of Oracle
Corporation. Various product and service names referenced herein may be trademarks of Oracle
Corporation. All other product and service names mentioned may be trademarks of their respective owners.
Disclaimer: This document is provided for information purposes only and the contents hereof are subject to
change without notice. Oracle Corporation does not warrant that this document is error-free, nor does it
provide any other warranties or conditions, whether expressed orally or implied in law, including implied
warranties and conditions of merchantability or fitness for a particular purpose. Oracle Corporation
specifically disclaims any liability with respect to this document and no contractual obligations are formed
either directly or indirectly by this document. This document may not be reproduced or transmitted in any
form or by any means, electronic or mechanical, for any purpose, without the prior written permission of
Oracle Corporation.
.
Problem Description ------------------- You are in Payables and are trying to retrieve all of the invoices for an
invoice batch. You are familiar with the invoice batch and know that not all of the invoices have been
returned. The Invoice Payables Option has been set to use Batch Control. The GL Date Basis has been
defined as System Date. Navigation Path: Invoices -> Entry -> Invoices -> Query Invoice Batches -> press
the Invoices button -> some invoice records are missing However, all of the invoices are displayed if you
inquire on the invoice batch via Invoices -> Inquiry -> Invoice Batches. Soultion Description ---------------------
You will need to open the AP Accounting Period for the period(s) associated with the invoices
which were not displayed in the invoice batch. Use the navigation path below to open the AP Accounting
Period: (N)Setup -> Calendar -> Accounting -> AP Accounting Period -> set the period to Open or Future
Open The AP Accounting Period may not be set to OPEN for the missing invoices.
.
--------------------------------------------------------------------------------
Copyright (c) 1995,2000 Oracle Corporation. All Rights Reserved. Legal Notices and Terms of Use.
Page 229 of 262
PURPOSE This document is intended to help users successfully troubleshoot problems when creating
intercompany invoices. SCOPE & APPLICATION This document is intended to supplement the
documentation provided with the application. Intercompany Invoicing
Troubleshooting the Interfaces To actually set up and test intercompany invoicing features, you will need to
run a sales order fully through its cycle and then follow the steps for generating the intercompany AR and
AP invoices. This can become tricky during integration testing, when both setups and raw data are in a
state of flux. Listed below are common issues that you may want to consider when troubleshooting records
in the interface tables. From OE into INV interface tables (running OE's Inventory Interface program) 1.
FlexBuilder or the Account Generator is looking to a source (order type, item, organization) for the
COGS account, but the account has not yet been assigned to its source. 2. One of the segments of the
COGS account has been disabled in GL, and is no longer available. 3. COGS segments exist on the
source and are valid, but the desired code combination is no longer valid. 4. Item Status is changed to
prevent transactions in Inventory. 5. Item control information is missing (lot, serial, revision). From INV
interface tables into INV (running the Inventory manager) 1. OE features are set up to allow shipment even
without onhand quantities, but Inventory features do not allow negative inventory. 2. Subinventory
and/or locator are wrong. 3. Item/subinventory restriction is changed while the record is in the interface.
4. Inventory period is not yet open. Between OE and INV for return processing (running OE's RMA
Interface program) 1. Depending on the order cycle requirements, the RMA interface (if not already
scheduled with automatic resubmission) may need to be run twice: once for the return information to be
communicated to Inventory, and once for the item's acceptance in Inventory to be communicate back to
OE. If this is not done, then the order line cycle status will show as being interfaced, but not yet
accepted. 2. OE: Source Code is not set; should be ORDER ENTRY. 3. Inspection is required and was
not performed. 4. Same COGS issues as with the original sales order. From OE into AR interface tables
(running OE's Receivables Interface program) 1. Order is on hold. 2. Order line is on hold. 3.
Receivables Interface is not running. 4. Invoice Source is not set up correctly (OE Import Standard or
Intercompany). It will not even show in the list of values when you run the Receivables interface
program. From AR interface tables into AR (running AR's AutoInvoice programs) 1. AutoAccounting is
looking to a source (item, salesrep, transaction type� ) for the necessary accounts, but the account is
not yet assigned to its source. 2. The account segments or the resulting code combination are not valid.
3. Salesperson's accounts or territory are incorrect. 4. The tax code or tax authority has not been set up
yet. 5. The appropriate Remittance Address assignment does not exist, corresponding to your invoice's
bill-to address requirements. Into AR interface tables (running INV's Create Intercompany AR Invoices
program) 1. Ensure that the Transaction Manager is running before you run "Create Intercompany AR
Invoices". One user found that while they were able to complete this program and produce a record in
the AR interface tables, they could not import the record (using AR's AutoInvoice Import) into AR.
With the manager down, a record had been created in INV's pending transactions interface. By clearing
the record from the pending transactions interface, they could successfully import into AR. 2. TIP: The
ID of the record in the "Create Intercompany AR Invoices" request log equals the material transaction ID
(helpful for researching issues). Into AP interface tables (running INV's Create Intercompany AP Invoices
program) 1. Payment Term in AP does not exist or does not match the spelling/case of the payment
term in AR on the intercompany AR invoice. 2. Same issue for the Tax Name in AP / Tax Code in AR. 3.
Missing or invalid supplier accounts. 4. Missing or invalid freight accounts. 5. Inconsistent profile option
settings amongst multiorg responsibilities (especially INV: Intercompany Currency Conversion - the
conversion type of the intercompany invoice. Cannot be 'User'.)
.
--------------------------------------------------------------------------------
Copyright (c) 1995,2000 Oracle Corporation. All Rights Reserved. Legal Notices and Terms of Use.
Page 230 of 262
Problem Description: ==================== You find that you could import invoices from legacy system
into an AP period which is already closed, but the corresponding GL period is still open. You have entered
an open period date as GL date in the Parameter while importing the invoices, and expected this date to be
GL date in the AP invoice,after importing. However, the result was the closed period date in the GL date
column of the AP invoices imported (Invoices/Entry/Invoices). GL Date for the closed period will cause
problem in AP transfer process to GL. Navigation Path: ---------------- (N)->Other->Requests->Run. Solution
Description: ===================== Workaround: Import invoices on timely basis: Make sure GL dates
in importing invoices are falling into Open AP period. Permanent Solutions for Rel. 10.7 and 11:
----------------------------------------- Option A. --------- 1. Apply patches,999563(available for both Rel. 10.7 and
11). 2. Also, additional patch 1040780--"May" need. After applying patch 999563, if getting ORA-01830
error, after populating expenditure_item_date field of the ap_expense_report_lines_all table, then
apply patch 1040780. (Currently, only avaible for Rel. 10.7. For rel.11, you need to request for one-off
patch. Per developer, Rel. 11 patch was not made, since nobody asked for it ) Option B. --------- Apply
Recent Patchset, Currently "U" (Rel. 10.7). Apply Recent Patchset, Currently "D" (Rel. 11) and one-off patch
1040780. See Option A.2 above for 1040780. [BUG:999563] is included in both patchsets
[BUG:1040780] is included in "U" only. Solution Explanation: ===================== Per original
patch 892224 (replaced by patch 999563), the fix solves the problem by ensuring that the GL date at the
distribution level rolls forward to the first day of the next open period, if the weekend/accounting date for the
source entity lies in a closed period. To achieve this end, code has been commented out in the apicdl.lpc file.
.
--------------------------------------------------------------------------------
Copyright (c) 1995,2000 Oracle Corporation. All Rights Reserved. Legal Notices and Terms of Use.
Bookmark Go to End
goal: How To Enter Invoices After Receipt Accrual-Period End Report Is Run
fix:
Note Role:
==========
1. Close the AP Period for which the report ¿Receipts Accrual - Period End¿
needs to be run.
2. Run the report ¿Receipts Accrual - Period End¿ from PO Responsibility
3. Swith to AP Responsibility
4. Open (re-open) the period that was closed in Step 1
5. Enter the invoices and if required, corresponding payments.
6. After completing the approvals, DO NOT run the online ¿Create Accounting¿
7. Submit the request ¿Payables Accounting Process¿
8. After successful completion of the aforesaid report, submit the request
¿Payables Transfer to General Ledger¿ with ¿Submit Journal Import¿ to NO
9. Run the "Journal Import" from GL Responsibility and post the
entries.
9. Close the AP period
Cautions:
· Oracle does not recommend to re-open the AP periods after the Receipts
Accrual - Period End report is completed.
· If an invoice is created for the same item already accrued in General Ledger
through Receipts Accrual - Period End report, a double charge for the
expense and a double accrual of liability is created.
.
Bookmark Go to End
Can a user send payments or invoices to AP and AR in any currency that has been activated in the reporting
currencies table?
Yes, a user can handle payments in Euro, and can change the currency before sending invoices to AP or AR. It is
also possible to convert a lease contract from NCU's to Euro. Because the conversion is made at the time the
currency is changed prior to being sent to AP/AR and then stored, you are able to send payments in one currency
for a certain time period, and then switch to another currency at a later time.
AP Invoices/AP Payments
Hi, All!
1. I?m trying to convert historical AP invoices into Oracle (Apps. 11.03). Is there?s any way I can
bring them over (by utilizing AP_INVOICES_INTERFACE and AP_INVOICE_LINES_INTERFACE tables)
with the
Page 232 of 262
2. Is there?s a safe (and not time consuming) programmatic way to load historical AP payments.
Thanks in advance
Sam
--------------------------------------------------------------------------------
You can import historical invoices into AP, but they cannot be imported as paid and posted.
What you can do once they are imported, though, is to create a payment batch that selects these historical
invoices and pays to a "dummy" bank. There is no need to print checks. Then they will be marked paid.
To post, run "AP Transfer to GL", and AP will mark the invoices and payments as posted. Assuming the
information is already in GL, there in no need to run Journal Import to get them to GL. Simply delete the
posting batch. Make sure that these historical invoices are the only ones selected for the posting, though.
--------------------------------------------------------------------------------
You can upload them with a 'fictive' payment group and select the whole payment group afterwards for
payment. This doesn't work for partial payments and should be tested first - I have no experience with it.
We are about to do the same exercise-so thanks for letting me know if you succeedded or took another way.
Regards
Filip Sillis
PriceWaterhouseCoopers - Brussels - Belgium
filip.sillis@be.pwcglobal.com
--------------------------------------------------------------------------------
Hi,
Page 233 of 262
I'm in the same boat as you people. Have you found any solution to the problem yet?
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Bookmark Go to End
2. Q: How is the as-of-date used in the "Accounts Payable Trial Balance" report?
A: The as-of-date is used to determine which invoices and payments should be included on the report. Any
invoices or payments with an accounting date AFTER the entered as-of-date will not be displayed on this
report.
[top]
3. Q: What articles, white papers, or manuals should I read for more information on Trial Balance?
A: Please see the Trial Balance Setup and Usage Guide for a complete list of available documents.
[top]
Page 234 of 262
4. Q: What are the keywords I should use when searching for Trial Balance on MetaLink?
A: Use the ORA and APP error codes that appear in the log file, if relevant.
For 10.7 and 11.0: Trial Balance, APXRTB
For 11.5 (11i): Trial Balance, APXTRBAL
[top]
5. Q: How is the 11i Trial Balance Different from 10.7 and 11.0 ?
A: The Accounts Payable Trial Balance is actually a new report but since the name is the same it is included
in the changed reports section. The new
accounting model made it necessary to rewrite the trial balance report. All of the enhancements that had
been outstanding against the report were
reviewed and incorporated into the new report. For example, there is now an option to run the report for a
single supplier. There is also an option to
run the report for a single liability account. For More information and a list of reports changed in 11i see AP
News Vol. 20.
[top]
IMPORTANT: If you did not find the information you were searching for, please review the following Payables
Trial Balance documents
Payables Trial Balance Current Issues
Payables Trial Balance One-Off Patches
Payables Trial Balance Setup and Usage Instructions
Payables Trial Balance Troubleshooting Guide
Payables Trial Balance Frequently Asked Questions (FAQ’s)
.
Problem Description ------------------- In Grants Management Sytem, unable to transfer paid and posted(to
GL) Supplier Invoices against POETA and also to adjust it from Project Expenditure Inquiry/ Special menu
for split, recalculate burden costs. Gives the following error messages:
PA_INV_AUTO_OFFSETS_PAID "You cannot make adjustments to this expenditure item because the
supplier invoice associated with this item has been paid and the automatic offset method is used to adjust
it". Steps involved: 1) Create an invoice from Payables Manager GUI. 2) Approve the Invoice. 3) Pay the
Invoice from Accounts Payable(AP). 4) Interface the invoice to General Ledger(GL) from AP. 5) From GMS,
run the PRC:Interface Supplier Invoice from Payables. 6) From Expenditure Inquiry/Actuals screen bring up
the expenditure item and try to perform a Transfer/Split/Recalculate Burden Cost. It gives the following
error: PA_INV_AUTO_OFFSETS_PAID. Solution Description ------------------- You need to have the
following setup in Payables -> Setup -> Options -> Payables. Set auto offset method to None and choose
Invoice from the drop down box and check the Allow Adjustments on Paid Invoices check box. Besides this
you need to apply an AP one-off server side patch 887905. This patch is included in AP patchset T but
Grants patchset 1.1D allows up to Q level for AP. 887905 can be applied on top of AP patchset Q(when
grants is installed) which will fix the problem of adjusting a paid supplier invoice. *** Warnings: Before
applying the patch take a back up of the database.
.
--------------------------------------------------------------------------------
Copyright (c) 1995,2000 Oracle Corporation. All Rights Reserved. Legal Notices and Terms of Use.
Page 235 of 262
Bookmark Go to End
fix:
If invoices are cancelled, the same invoice numbers cannot be used again...the
invoice numbers will all ready exist for the vendors and cannot be used.
OR
2. Delete each invoice (Delete the invoice by quering up the invoice and then
hitting the red X in the tool bar. Then hit save to save the deletion) After
all the invoices are deleted from the interface table, then delete the
information from the interface tables (using sql plus) and then reload the data
and re-import.
Option 1. is the cleanest option and the option recommended by Oracle support.
.
8. Suppliers
8.i There is more than one account for the same supplier, which one do I choose?
Check the supplier site addresses and choose the supplier whose site address matches your
invoice address. If none of them match your invoice then ask DP section to create a new site. If all
the supplier accounts have the same site addresses then choose the Supplier with the lowest
number. We are in the process of merging all the multiple accounts into one.
Please send details of the supplier or employee to DP section. Minimum details required are as
follows:
Name and full address
If an individual please confirm if the person is an employee or not
Standard forms for full supplier set-up can be obtained from DP section.
9. Batch Headers
Page 236 of 262
Select the batch header you want to print by clicking on Query, and Find. Then enter the batch
number you require and click on the Find button
The system brings up the batch details
Confirm that you have the right folder open ie UCL BATCH HEADER
Click on the Action menu and then click Print
A copy of the batch header would be printed on your printer
You can change the invoice type on the batch header after entering invoices against a batch
and the new invoice type will default onto new invoices entered after the change. Changing the
batch header does not affect invoices entered before the change
You can delete an invoice from a batch at any time before the invoice has been approved. See
5.i
You cannot delete an invoice batch that contains invoices. If you want to delete an invoice
batch, you must delete the invoices in the batch first. See 5.i
10.ii I am unable to enter a grant distribution against a 6P … expenditure type because the system is
requesting for a valid quantity
10.iii I wish to enter a distribution against a grant code but the system is requesting for an expenditure
Item date
In this case you are trying to enter an expense against a completed grant. Please confirm the
completion date of the grant and enter a date on or before the grant completion date. You can
confirm the date as follows:
Select the grant field
Click on the picklist button on the toolbar or press CTRL+F11
Enter the grant code and click the Find button
The system would then bring up brief details about the grant.
Scroll to the right to view the grant completion date.
10.iv I have entered my distributions against grant codes and the system generated account codes are
different from the grant codes that I entered?
The grants were set-up to map to control accounts in the general ledger. The account codes for
these control accounts are different from the grant codes that you have entered. See further details
on COA Philosophy document on the NewFis website
11.i How do I confirm that the VAT amount is correct before the first level approval process is run?
Choose Generate VAT distributions. The system then comes up with a note indicating that VAT
is being calculated, click OK on the box and wait for the system to complete the process by
bringing up the VAT lines and updating the distribution total.
Check that your Invoice total agree with the distribution total, if not then make the necessary
changes as described in section 4.ii below.
11.ii System calculated VAT amount does not agree with the invoice VAT amount due to rounding
differences or insignificant arithmetical errors on Supplier invoices
Manually change the system calculated VAT amount on the VAT distribution line to agree with the
invoice VAT amount.
11.iii Most of our expenses are VAT recoverable, and I am not sure of the VAT codes to use
Recoverability is now defined at the account code level. The code to enter is the one that
corresponds with the VAT rate on your invoice. Please find further details on the VAT overview
document on the Newfis website.
12. Adjusting and deleting invoices and invoice distributions
12.i.i If invoice is unapproved (first level approval has not been done)
Ensure that you are on the invoices window and the cursor is on the invoice line that you wish
to delete
Click on the red X button on your toolbar
Click OK on the delete message box.
Once the deletion is completed save your work.
An approved Invoice cannot be deleted because funds have already been committed against the
invoice during the approval process. However, the system would allow you to cancel the invoice.
On your invoices screen, click on the Actions..1 button and this brings up the Actions wndow.
On the Actions window click on the Cancel Invoice check box
Click OK and click OK to the messages that come up during the cancellation process.
Once the process have been completed save your work
12.iii I have entered an expense claim with the wrong invoice type, how do I correct this error
Delete the invoice and re-enter it with the standard invoice type.
Before approval
Purchase order matched distributions cannot be adjusted but can be reversed and the correcting
entries entered on a new distribution line.
Distribution details that are not generated from purchase orders can be changed or deleted
before the first level approval stage. Follow the procedure for adjusting invoices and remember to
save your work .
Page 238 of 262
Distributions cannot be amended or deleted once they have been approved. The system would
only allow you to reverse the entries by clicking on the Reverse …1 button.
12.v Please see the invoice adjustment chart at the end of this document.
13.i After running the batch approval process, how do I confirm that all the invoices in the batch have
been approved?
The batch approval process normally takes a few minutes to run. The time it takes depend on
the number of entries in the batch and how busy the system is. Please wait a few minutes
before checking that all the invoices in your batch have been approved.
After waiting for a few minutes you may open the invoices window of the batch and click on
Query, then Run. This refreshes the screen and you may then check if your invoices have been
approved by reviewing the holds placed on them.
If you process large volumes of batches then it is advisable to print the Invoice on Hold report
once or twice a day instead of checking batches individually. See page 45 of your AP training
documentation for guidance on how to print reports.
13.ii I have approved my invoices but don't know where they have gone for secondary approval?
Invoices are automatically available for all authorised signatories in your Department once the First
Level approval is carried out. You do not need to send them to anyone for approval.
13.iii An invoice was not approved in my batch of 10 invoices. Does this stop the rest from being
processed further?
No
14. General advice
14.i It is advisable that you print out or review the Invoice on Hold Report at the end of every day to
ensure that all your invoices were successfully entered.
14.ii You may approve more than one batch at a time. To do this
Navigate to the Invoice batches window
Press the SHIFT key and then click on the invoice batches that you wish to approve. The
batches would become highlighted in blue and the Approve button would indicate the number
of batches that you have highlighted
Lift your finger off the shift key and then click on the approve button
The system would ask you to confirm the number of batches to be approved.
Click OK
14.iii The on screen 'help' is very useful and provides the following information:
Window help: topics relating to the window you are working on
Keyboard help : A list of keyboard shortcuts
View My Request : Confirm the status of your requests
Page 239 of 262
About this Record: Details of who created a record and when it was created
Page 240 of 262
Page 241 of 262
1. What are the types of Invoices , what is prepayment & steps to apply it to an Invoice ?
7. What is Tolerance?
11. Which interface tables are used for Invoice Import , give the important columns?
14. You created a set of book , where you will attach this SOB in AP?
19. Explain the set up used for Automatic or Manual Supplier Numbering.
20. Can you hold the partial payment if yes then how?
1) when you create a table as ‘create table xyz as select * from abc’- what all are copied from the table
xyz?
Page 242 of 262
a) All constraints
b) Only primary keys
c) Only foreign keys
d) Only not null constraints
Ans : d
a) 15
b) 30
c) 50
d) 255
Ans :b
a) 255 bytes
b) 2000 bytes
c) 4000 bytes
d) None of above
Ans : c
4) When a table is dropped , what happens to the view defined on that table?
Ans : c
Ans : c
6) which data dictionary view has source code of stored procedures
a) USER_PROCEDURES
b) USER_SOURCE
c) USER_OBJECTS
d) None
Ans : b
Ans : b
Page 243 of 262
8) which is the built in used for sending Operating system commands from forms
a) spool
b) host
c) command
d) cannot be done in forms
Ans : b
9) show_lov returns
a) number
b) varchar2
c) boolean
d) none
Ans : c
a) One
b) two
c) four
d) any number
Ans : a
a) set_form_property
b) set_window_property
c) set_canvas_property
d) set_block_property
Ans : b
[[[
13) what is datatype of Global variables
a) number
b) character
c) both a & b
d) None
Ans :b
Ans : b
500
NA
1400
NA
NA
8. Oracle cursor : Implicit & Explicit cursors
Oracle uses work areas called private SQL areas to create SQL statements.
PL/SQL construct to identify each and every work are used, is called as Cursor.
For SQL queries returning a single row, PL/SQL declares all implicit cursors.
For queries that returning more than one row, the cursor needs to be explicitly declared.
9. Explicit Cursor attributes
There are four cursor attributes used in Oracle
cursor_name%Found, cursor_name%NOTFOUND, cursor_name%ROWCOUNT, cursor_name%ISOPEN
10. Implicit Cursor attributes
Same as explicit cursor but prefixed by the word SQL
SQL%Found, SQL%NOTFOUND, SQL%ROWCOUNT, SQL%ISOPEN
Tips : 1. Here SQL%ISOPEN is false, because oracle automatically closed the implicit cursor after executing
SQL statements.
: 2. All are Boolean attributes.
11. Find out nth highest salary from emp table
SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP
B WHERE a.sal<=b.sal);
Enter value for n: 2
SAL
---------
3700
12. To view installed Oracle version information
SQL> select banner from v$version;
13. Display the number value in Words
SQL> select sal, (to_char(to_date(sal,'j'), 'jsp'))
from emp;
the output like,
SAL (TO_CHAR(TO_DATE(SAL,'J'),'JSP'))
--------- -----------------------------------------------------
800 eight hundred
1600 one thousand six hundred
1250 one thousand two hundred fifty
If you want to add some text like,
Rs. Three Thousand only.
SQL> select sal "Salary ",
(' Rs. '|| (to_char(to_date(sal,'j'), 'Jsp'))|| ' only.'))
"Sal in Words" from emp
/
Salary Sal in Words
------- ------------------------------------------------------
800 Rs. Eight Hundred only.
1600 Rs. One Thousand Six Hundred only.
1250 Rs. One Thousand Two Hundred Fifty only.
14. Display Odd/ Even number of records
Odd number of records:
select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp);
1
3
5
Even number of records:
select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)
2
4
6
15. Which date function returns number value?
months_between
Page 246 of 262
Oracle –Reports 6i
Yes it is possible to run the report without parameter form by setting the PARAM value to Null
4.What are the minimum number of groups required for a matrix report?
Answer : 4
in Report Builder?
11. Which of the following Procedures displays message number and text
that you specify?
Answer : SRW.MESSAGE
This procedure displays a message with the message number and text that you specify. The message is
displayed in the format below. After the message is raised and you accept it, the report execution will
continue.
1. Execution methods?
Ans. a. Host
b. Immediate
c. Java Stored Procedure
d. Java Concurrent Program
e. Multi Language Function
f. Oracle Reports
g. PL/SQL Stored Procedure
h. Request Set Stage Function
i. Spawned
j. SQL*Loader
k. SQL*Plus
FND SRWINIT - This is a User Exit which sets your profile option values and allows Oracle AOL user exits
to detect that they have been called by oracle repots. Can be used in BEFORE-REPORT Trigger.
FND_SRWEXIT - This user exit ensures that all the memory allocated for
AOL user exits has been freed up properly. Can be used in AFTER- REPORT Trigger
FND FLEXSQL - This user exits allows you to use Flex fields in Reports
FND FLEXIDVAL - This user exits allows you to use Flex fields in Reports
A stage is a component of a request set used to group requests within the set. All of the requests in a given
stage are executed in parallel. Advantages of stages are the ability to execute several requests in parallel
and then move sequentially to the next stage.
Responsibility: System Administrator
Page 249 of 262
Bind references (or bind variables) are used to replace a single value in SQL or PL/SQL, such as a
character string, number, or date. Specifically, 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 may not be referenced in FROM clauses or in place of reserved words or clauses. You
create a bind reference by entering a colon (:) followed immediately by the column or parameter name.
Navigation Path:
Login – Application Developer -> Application -> Validation -> Set
Application: Although the default for this field is the application of your concurrent program, you can enter
any valid application name.
Name: The program name and application you specify must uniquely identify a concurrent program. Your list
displays the user-friendly name of the program, the short name, and the description of the program.
Scope: Enter Set or Program Only to specify whether your concurrent program is incompatible with this
program and all its child requests (Set) or only with this program (Program Only).
Run Alone: Indicate whether your program should run alone relative to all other programs in the same
logical database. If the execution of your program interferes with the execution of all other programs in the
same logical database (in other words, if your program is incompatible with all programs in its logical
database, including itself), it should run alone.
Operating Units
Inventory Organizations
Financial Modules
Ans. Enter employee records. Either your Human Resources department enters employee information in
the People window (if HRMS is installed), or the appropriate department enters employee information in the
Enter Person window. To ensure that Payables can create a supplier record during Invoice Import, the
following are requirements for each employee record:
the employee name is unique
reimbursement address for either Home or Office exists
address lines 1-3 for the home address do not exceed 35 characters
City/State/Country does not exceed 25 characters
Zip Code for the home address does not exceed 20 characters
RA_CUSTOMER_TRX
RA_CUSTOMER_TRX_LINES
RA_CUST_TRX_LINE_GL_DIST
AR_PAYMENT_SCHEDULES
Here is an example to help explain how Oracle Reports are designed and printed in both the bitmap and
character-mode environments.
Assume you wish to print "Cc" where "C" is a different font and a larger point size than "c" and is in boldface
type (where "c" is not).
In Oracle Reports Designer, bitmap mode, you can make "C" bold and in a different font and point size than
"c". This is because you are generating postscript output. Postscript is a universal printer language and any
postscript printer is able to interpret your different design instructions.
In Oracle Reports Designer, character mode, the APPLICATIONS STANDARDS REQUIRE the report to be
designed in ONE FONT/ ONE CHARACTER SIZE. Character mode reports generate ASCII output. In
ASCII you cannot dynamically change the font and character size. The standard is in effect so a report prints
as identically as possible from both conventional and postscript printers.
These sequences contrast the two printing environments. In postscript, "C" can be in a different font and
point size than "c". Both or either could also be bold, for example.
In ASCII, "C" must be in the same font and character size as "c". Both or either could also be bold, for
example.
a) EVENT ALERTS are triggered when an event or change is made to a table in the database.
b) PERIODIC ALERTS are activated on a scheduled basis to monitor database activities or changes.
3. Close the Layout Editor window. Under Data Model, open up the 'System Parameters'
4.Right Click on 'MODE' and select 'Properties' Enter 'BITMAP' as the 'Initial Value' and click OK. Save the
report - call it 'first.rdf'.
6. Set the FORMAT to POSTSCRIPT and style as A4. in the concurrent program.
Procedure:
Defines an error token and substitutes it with a value. Calls to TOKEN( ) and RAISE( ) raise predefined
errors for Oracle Workflow that are stored in the WF_RESOURCES table. The error messages contain
tokens that need to be replaced with relevant values when the error message is raised. This is an alternative
to raising PL/SQL standard exceptions or custom-defined exceptions.
Syntax
procedure TOKEN
(token_name in varchar2,
token_value in varchar2);
Procedures do not return values which functions return one One Value.
Packages: Packages provide a method of encapsulating and storing related procedures, functions,
variables and other package contents.
Tracefile The name of the trace statistics file, which is found in the user_dump_dest directory (Normally
$ORACLE_HOME/rdbms/log)
Outputfile The name of the output file
Explain=username/password instructs the TKProf to run explai on the SQL statement in order to
explain the access path. This is essential for performance investigation
Sys=no TKProf skips recursive SQL and statements run as the SYS user. Used rarely.
CALL_FORM: Runs an indicated form while keeping the parent form active. Form Builder runs the called
form with the same Runform preferences as the parent form. When the called form is exited Form Builder
processing resumes in the calling form at the point from which you initiated the call to CALL_FORM.
OPEN_FORM: Opens the indicated form. Use OPEN_FORM to create multiple-form applications, that is,
applications that open more than one form at the same time.
NEW_FORM: Exits the current form and enters the indicated form. The calling form is terminated as the
parent form. If the calling form had been called by a higher form, Form Builder keeps the higher call active
and treats it as a call to the new form. Form Builder releases memory (such as database cursors) that the
terminated form was using. Form Builder runs the new form with the same Runform options as the parent
form. If the parent form was a called form, Form Builder runs the new form with the same options as the
parent form.
Statement Printing AR
Source files : ARXGSP internally calling ARXSGPO
Tables Effected:
TEMP_ARSHR - AR_STATEMENT_HEADERS
TEMP_ARSLC - AR_STATEMENT_LINE_CLUSTERS
TEMP_ADJ - AR_ADJUSTMENT
HZ_CUST_ACCOUNTS
HZ_PARTIES
HZ_LOCATIONS
HZ_CUST_ACCT_SITES
HZ_PARTY_SITES
FND_TERRITORIES
Lookup Tables:
AR_LOOKUPS
AR_PAYMENT_SCHEDULES
AR Invoice Printing
Tables:
AR_INVOICE_HEADERS_V
AR_INVOICE_LINES_V
AR_TAX_LINES_V
Tables:
PO_HEADERS_PRINT
PO_LINES_PRINT
Lookup Objects:
PO_LINE_LOCATIONS_PRINT
PO_VENDOR_CONTACTS
PO_DISTRIBUTIONS_ALL
HR_EMPLOYEES
HR_LOCATIONS
Check Printing
Source: APXPBFEL
1) Company Logo
2) No Check number
3) Stationary 8.5 X 11
Positive Pay
Source : APXPOPAY
Report definition
FLEX MODE Layout Editor mode that automatically resizes or shrinks parent objects when child objects are
moved or resized, and adjusts the positions of other layout objects that might otherwise be affected by the
repositioning or resizing of the objects.
CONFINE MODE Layout editor mode that prevents child objects from being moved or resized on or outside
their parent objects.
ANCHORA Layout object used to fix a spot on one object to a spot on another object, ensuring the position
of the first object in relation to the second object.
ANONYMOUS BLOCK A PL/SQL program unit that has no name and does not require the explicit
presence of the BEGIN and END keywords to enclose the executable statements. Since they are unnamed,
anonymous blocks cannot be referenced by other program units.
Page 258 of 262
BOILERPLATE := Text and/or graphics that appear in a report every time it is run. In some products this is
called "constant" text or graphics.
CURSOR:= 1. A small icon representing the position of the mouse. The shape of the cursor varies,
depending on the selected tool.
2. An internal pointer to data retrieved by a query. A cursor points only to one row of data at a time;
however, you can use built-in subprograms to move the cursor to any row in the data set.
DATABASE TRIGGER:= A stored PL/SQL block that is implicitly executed when a triggering INSERT,
UPDATE, or DELETE statement is issued against the associated table in the database. See also: debug
trigger.
FOREIGN KEY := A value or column in one table that refers to a primary key in another table.
FORMET TRIGGER :=A PL/SQL function that allows you to dynamically change the formatting attributes
of an object.
FORMULA COLUMN := A user-created column that gets its data from a PL/SQL function or expression, a
user exit, a SQL statement, or any combination of these.
FRAME = In Graphics Builder, the part of a chart template that defines the basic structure of a chart, but
does not determine the way the data is plotted.
2. In Report Builder, a layout object used to enclose other layout objects and control the formatting,
frequency, and positioning of several objects simultaneously.
FUNCTION = A PL/SQL subprogram that performs a specified sequence of actions, and then returns a
value. Can reside and execute on the client and the database server.
GLOBAL VARIABLE = A logical container that exists across an application. When an application uses a
global variable, the application maintains the variable until the application is exited, or until another object
explicitly removes it.
GROUP FILTER A PL/SQL function that restricts the data fetched by a group.
INDEX = An optional structure associated with a table that is used by Oracle Server to locate rows of the
table quickly, and (optionally) to guarantee that every row is unique.
INSERT MODE = A mode in which each character you enter is inserted at the cursor, pushing the following
characters to the right. The opposite of replace mode.
LAXICAL REFERENCE = A reference to a parameter used to represent a string of text in a SQL SELECT
statement. For a lexical reference, you must precede the parameter name with an ampersand (&).
LOCAL VARIABLE = A PL/SQL variable declared only within the scope of the current program unit.
PACKAGE FUNCTION = A PL/SQL function provided with the software that can be referenced anywhere
within a program unit.
PACKAGE = A method of encapsulating and storing related procedures, functions, variables, and other
package constructs together as a unit in the database or on the client. While packages provide the
database administrator or application developer organizational benefits, they also offer increased
functionality and database performance. The software provides several built-in packages which contain
PL/SQL constructs that can be referenced by client-side program units (e.g., TEXT_IO package). Several
packages are also supplied with the Oracle database server for referencing by stored program units (e.g.,
DBMS_OUTPUT package).
Page 259 of 262
PACKAGE BODY = Includes the actual implementation of the package, which may include private
subprograms and datatypes. The body is optional if the package consists only of declarations.
PACKAGE SPECIFICATION = Includes the actual implementation of the package, which may include
private subprograms and datatypes. The body is optional if the package consists only of declarations.
PARAMETER = 1. A PL/SQL construct used to pass information to a subprogram. For example, in the
subprogram call MYPROC (x),x is a parameter. 2. In Forms Developer, parameters are used to pass
information between components such as Form Builder and Graphics Builder. 3. A variable you can change
at runtime.
PLOT TYPE = The type of element used to plot a field on a chart, such as bar, line, or symbol.
PL/SQL = Oracle's proprietary extension to the SQL language. Adds procedural and other constructs to
SQL that make it suitable for writing applications.
PRIEVIEVE = The interface with which you view and scroll through report output online.
PRIMARY KEY = A column in a database table whose members consist of unique values that can be used
to identify a row in a table.
PROCEDURE = A PL/SQL subprogram that performs a specified sequence of actions. . Can reside and
execute on the client and the database server.
PROGRAM UNIT = A PL/SQL code structure that can be independently recognized and processed by the
PL/SQL compiler. Anonymous blocks, subprogram specifications and bodies (procedures and functions),
and package specifications and bodies are types of program units. Program units can reside and execute
on the client and the database server. See also: stored program unit.
PROJECT NAVIGATOR = The window containing a hierarchical list of project items for the current session.
The list appears in outline form, and enables the user to accomplish several tasks such as creating, editing,
renaming, and deleting objects. Although only one is visible at any time, the user can choose from two
different schema by which to organize the objects.
PROPERTY = A characteristic of an object that determines the behavior or appearance of that object.
PROPERTY CLASS = A named object that contains a list of properties and their settings used to globally
control the appearance and functionality of objects based on that class.
RDBMS = Acronym for Relational Database Management System. A database that allows the definition of
data structures, storage and retrieval operations, and integrity constraints. In such a database, data and
relations between them are organized in tables.
RECORD GROUP = An internal data structure object with a column/row framework, that belong to the form
module in which they are defined.
RELATIONAL OPERATOR = A symbol used in search criteria to indicate a comparison between two values,
such as the equal sign in "WHERE DEPTNO = 10." Rows in which the comparison results in "true" are
returned in the result (fetched), while rows in which the comparison returns "false" are rejected from the
result.
Page 260 of 262
REPEATING FRAME = A layout object used to display rows of data that are fetched for a group.
REPLACE MODE A mode in which each character you type replaces the current character at the cursor.
The opposite of insert mode.
SCHEMA = A collection of related database objects, usually grouped by database userid. Schema objects
includes tables, views, sequences, stored program units, synonyms, indexes, clusters, and database links.
SELECTOR = (Oracle Express) A set of tools that you use to choose the dimension values to include, for
instance, in a report, table, graph, or dimension list box. For example, you can use the Selector to choose
the top 10 cities based on Sales or those cities whose Sales exceeded Quota by 15 percent. The Selector
also allows you to sort dimension values and to create and retrieve saved selections.
SQL = A standard interface for storing and retrieving information in a relational database. SQL is an
acronym for Structured Query Language.
SQL SCRIPT A file containing SQL statements that you can run to perform database administration quickly
and easily. Several SQL scripts are shipped with Oracle products.
SQL STATEMENT = A SQL instruction to Oracle. A SELECT statement is one type of SQL statement.
SUMMARY COLUMN = A column, with a type of summary, which computes subtotals, grand totals, running
totals, and other summaries of the data in a report, using one of the packaged summary functions provided
by Report Builder.
SYNTEX VARIABLE = One of the variables that are provided with Reports Developer (e.g., &Logical Page,
DESTYPE).
TABLE = A named collection of related information, stored in a relational database or server, in a two-
dimensional grid that is made up of rows and columns.
TABLE TYPE = A named collection of related information, stored in a relational database or server, in a two-
dimensional grid that is made up of rows and columns.
USER EXIT = A way in which to pass control (and possibly arguments) from Forms Developer to another
Oracle product or 3GL, and then return control (and possibly arguments) back to Forms Developer.
USER DEFINED ACTION = A custom action defined by a Project Builder user. Such actions may apply to
any single file type, or to all file types. See also: action, pre-defined action.
VARIABLE = A named object that can be assigned a value and whose assigned value may change over
time.
VISUAL ATTRIBUTE = A named object that can be assigned a value and whose assigned value may
change over time.
SYSTEM ADMINISTRATION
1. What do you need to do to allow a different user to see your output file?
A. The user must log on as a system administrator.
Page 261 of 262
B. The user must have the View My Requests form in system administrator mode.
C. The user must be logged on with the same responsibility as the user that generated the
output file, and the profile option Concurrent: Report Access Level value must be set to
Responsibility.
D. The user must be logged on as the same responsibility as the one that generated the
output file and profile option Concurrent: Report Access Level value is User.
Answer: C
5. Which of the following operations cannot be performed with the internal concurrent manager?
A. Restart
B. Verify
C. Deactivate
D. Terminate
Answer: A
1. Which one of the following will be the correct outcome with two include rules in a combined rule?
A. Program will be included if the program is in one of the include rules
B. Program will be included if the program is in both of the include rules
C. Program will be included if the program is run by one of the two Oracle IDs in the
include rules
D. None of the above
Answer: B
43146. When will the number of actual processes be less than the number of target processes?
A. When the concurrent manager is down
B. When the concurrent manager is coming up
C. When there are not enough requests
D. All of the above
Answer: D
1. Which of the following is the overriding level for profile option values?
A. Site
B. Application
C. Responsibility
Page 262 of 262
D. User
Answer: D
1. Which of the following is the correct sequence for setting up database change audits?
A. Audit installations, audit tables, audit groups, audit trail update tables request
B. Audit installation, audit groups, audit tables, audit trail update tables request
C. Audit trail update tables request, audit installation, audit groups, audit tables
D. Audit groups, audit tables, audit trail update tables request, Audit Installation
Answer: B