Sie sind auf Seite 1von 18

1. What is the diff between Exist and In Operator?

Exists return Boolean and in return values.


2. What is the Diff between Delete and Truncate and Drop?
delete dml explicit commit required,
truncate- ddl implicit commit,
drop ddl drop db objects permanently from db.
3. Can we drop the table if table is having the data?
NO.
4. I have executed the Delete command after the I have created table wether deletions

will be commit or not?if table is success fully created?


commit
5. I have executed the Delete command after the I have created table wether deletions

will be commit or not?if table is not created?


Error table or view does not exists
6. What is RowID ? When it will be created? What is the format? What is the diff

between RowID and Rownum?


It is pseudocol associated to each row of table,18 charcters long hexadecimal,rowid is
associated when each row is created while rownum is attached to each row when it is
retrieved from db in a query.
7. Can we use RowID in the where clause? if Yes can we use like follows
Yes
8. Where rowid = 12;
No. We have to use hexadecinal format.
9. What is Decode operator and what is the syntax when u have used in Oracle Apps?
it is an used in sql for if-else-then as in procedural language ,compares expression value

by value and if matches return corresponding result else return default and if default is
omitted return null
syntax: decode(gender,m,1,f,1,0);
10. What is NVL operator and what is the syntax when u have used in Oracle Apps?
it is function used to deal with null values.it return value if found col value null else

return col value


syntax: nvl(commission,0);
11. What are Join and types of Joins and what is Outer Join?
It is query that combines rows from 2 or more tables.
o Types: equi, nonequi, self, outer join
Outer join is a join which extract all the rows from one table and matching rows from

other table based on the outer join operator(+)


i.

What is set operator and what are the types what is the diff between Set operators
and Joins?
These operators are used to join the o/p of 2 queries.
Types: union, union all, intersect, minus.
Difference - Set operator require same structure of both queries while join need not
require this
13. What is View? What is the advantage? What are the types of views we have?
It is also a db objects .it is virtual table that is not having data of its own.
Easy retrieval of the data from database
Types: updatable, not updateable (or) simple ,complex
14. When we can not update the view?
When it contains joins, set operators, Rownum, group by ,having
15. What is Materialized view and what is Snap shot?
It is replicas of data from remote database, local copy of remote table, used for

replication, distributing, computing. Used in large data like db warehousing.


It is a view which is associated with a query having any no of joins and any no of group
functions
We cant perform DML operations in Materialized views
Snap shot is used for increase the performance by reducing network traffic by reducing
i/o
In older version of oracle is called as snapshot
It is used for replication of data between distributed databases.

16. What is the diff between Materialized view and Snap shot?
No difference
17. What are the Inline views?

Sub query defined in from clause of select statement.


In place of table name in from clause of select statement, we write sub query that is
inline view.
It is also a virtual table.

18. What is synonym and what are the types and what is the advantage?
Synonym is an alternate name for a table, view.
Two types public, private
19. What is Index? Advantage of Index? Types of Indexes?
Create indexes if u frequently want to retrieve less than 15% of the rows in a large table
o Index columns used for join to improve the performance on joins.
o Dont use indexes on tables having less no rows.
o If the column has non-unique values u can use indexes on these columns.
o Dont use indexes if the data type is lob, CLOB & BLOB.
o If the table is read only we can create more indexes on the table.
o We can't create indexes on views.
o Indexes are logically & physically independent of data
o If the index is developed all applications continue to function

Index is an ordered list of contents of a column or group of columns in a table. Index


created on a single table Simple Index and which is created on multiple tables is called
Composite Index.
CREATE INDEX Index_Name ON Table_Name (Column_Name);
DROP INDEX (Index_Name);
Types
o Normal
o Composite
o Unique
o Function based

20. What is the Bit mapped Index advantage?


It is used for low coordination number
21. What is sub-query and what is Co-Related Sub Query and diff between those two?
Sub Query is select statement which is embedded with the other select statement and

which executes once before the main query execution.


Co Related sub query is for row by row processing, in this first inner query will be

executed once based on that out query will be executed for each row.
22. What is the syntax for To Date function?
To_Date (DD-MON-RR)
23. What is diff between Replace and Translate?
Replace is to replace character by character in a string
Where as Translate is used for to replace string
24. What are the Pseudo columns we have?
They behave like table columns, but are not actually stored in the table.
o CURRVAL, NEXTVAL, ROWID, ROWNUM, SYSDATE, LEVEL, USER, UID

PARSING:
It checks the Syntax of SQL Statements.
25. How to execute DOS Commands from SQL Prompt?
HOST
26. How can we find out no of Indexes we have create against a Table?
USER_INDEXES
27. How to get second max salary from the table?

Select * from emp


where sal in (select max(sal) from emp a
where sal <(select max(sal) from emp b))
28. How to delete duplicate rows from the table?

DELETE FROM EMP A


WHERE ROWID>(SELECT MIN(ROWID)
FROM EMP B
WHERE A.EMPNO=B.EMPNO)
29. What is where clause?
Conditional Clause
30. What is having clause and what is the diff between these two clauses?
Having Clause is used with Group Functions
Where Clause is used for simple conditions

31. How to handle the table level locks and column level locks?
Shared/exclusive -When 2 transaction wants to read/write from db at the same time.
Table level, row level
Row Exclusive locks are obtained when updating, inserting or deleting rows

Duration of locks

All locks acquired during a transaction are released when the transaction is
committed
All locks are acquired during a transaction are released when the transaction is rolled
back
All locks are acquired after a savepoint are released when the transaction is rolled
back to the savepoint
Dead lock-It is will come in multi-user environment
When the two users issues update statements then dead lock will come
Dead- 1trans updates EMP and dep
2 trans update dep and EMP
Dead locks are released when commit/rollback statements are issued or logging off

32. What are the constraints we have and how to declare?


Which enforces the rules at table level
Not Null
Unique
Primary Key
Foreign Key
Check
o Create constraint <Constraint Name> Constraint Type
33. What is the diff between primary key and Unique?

Primary is a combination of unique + notnull


Table can have only one Primary Key
Table can have number of Unique Keys

34. Can we compare two Null values? Can we insert more than one null value in the

unique column?
No, Yes
35. How to handle null values?
NVL function

36. What are CBO and RBO? What is the diff between these two?
Cost Based optimization
Role Based optimization
37. What are the performing tuning levels?
38. What is Explain plan and what is TKPROFF?
39. How can u tune the query?
- EXPLAN_PLAN
40. How to display odd rows

SELECT ROWNUM,ENAME FROM EMP


GROUP BY ROWNUM,ENAME
HAVING MOD(ROWNUM,2)=1
select * from emp
where (rowid,1) in (select rowid, mod(rownum,2) from emp);

PL/SQL:
1. What is Exception? Types of Exceptions? Exception Propagations?
Exception is a warning or error condition in oracle
o User defined
o Pre-defined
2. What is RAISE_APPLICATION_ERROR? And what is PRAGMA EXCEPTION_

INIT?
RAISE_APPLICATION_ERROR is an user defined exception, used explicitly
in triggers to display appropriate messages, it contains to parameters as message
code and message
User defined message codes are( -20,999 to -20,000)
PRAGMA EXCEPTION is used to write the our own error message with oracle
error number
predefined message codes are (-19,999 to -1)

3. What are the Predefined exceptions we have?


Predefined exception is nothing but already defined by Oracle,
like :
o NO_DATA_FOUND Activated when select stmt is failed to retrieve data.
o TOO_MANY_ROWS Activated when select stmt retrieve more than one
o
o
o
o
o
o
o
o
o
o

value into variables.


VALUE_ERROR Activated when data type is not matching with value
provided.
ZERO_DIVIDE
DUP_VAL_ON_INDEX
INVALID_DATA
INVALID_CURSOR
CURSOR_ALREADY_OPEN
TRANSACTION_BACKED_OUT
STORAGE_ERROR
TIME_OUT_ON_RESOURES
LOGIN_DENIED

so on
4. When we SELECT statement in the Execution block what are the Predefined

exceptions we have to use in the Exception Block?


NO_DATA_FOUND
TOO-MANY_ROWS
ZERO_DEVID_VALUE so on
5. What is the diff between NO_DATA_FOUND and %NOT FOUND
NO_DATA_FOUND

Predefined Exception
%NOT FOUND

CURSOR attribute
6. What is CURSOR? What are the Cursor types? What are cursor declaration steps?

Cursor is nothing but a private SQL work area which is used to store process
information.
Types Implicit Explicit
Declare Cursor
Open Cursor
Fetch Cursor
Close Cursor

7. What is the diff between Implicit and Explicit and Ref Cursor?
Implicit It is defined by the Oracle Server for queries that return only one row.
Explicit Which is defined by the Users, for queries that return more than one row
Ref With this we can change the select statement dynamically.
o Pass the cursor data as parameter to procedure or function.
o Without closing we can again open the cursor.
8. In which program u has used the Cursor? One example for implicit cursor?
9. What are the Cursor attributes we have?
%OPEN
%NOT FOUND
%FOUND
%ROWCOUNT
10. Can we issue the commit inside of the Cursor For Loop?
Yes
11. What is For Update OF Clause in the Cursors?
Is used in cursor to lock the rows first before u performs DML operations.

12. What is Procedure and what is Function?


Procedure: Is used perform an action
Function: Is used to compute a value
13. What are the RND and WND?

RND Read No Database


WND Write No Database
14. What is the diff between Procedure and Function?
Function must return only one value, where procedure may or may not return value.
15. When we will create Procedure and when we will create function?
Procedure is used when u want to return multiple values where as functions r used to

return a single value.


16. What is the diff between Package procedure and Standalone procedure?

Standalone Procedure: Will call with procedure name


Package Procedure: will call with package.procedure
17. If we the procedure then how? drop the table which we have used in the procedure do

we need to recompile
Yes, we need to recompile the procedure by using below command
- ALTER PROCEDURE <proc_name> COMPILE
18. How to get the Procedure Source code from database?

SELECT * FROM USER_SOURCE - Text is the column name


19. What is the Advantage of Package?
We can declare the global variables
Other users cant see the package body or logic what it contains.
Encapsulation
Hiding info
Added functionality
Better performance
Overloading
20. What are the other objects we can group inside of Package?

Procedures
Functions
Variables
Cursors
Constants
21. How to Recompile the Package?

Alter Package <Package Name>


22. When we will go for creation of Package? Can we create Package body without

creation of Package Specification?


NO
23. Can we declare Procedure directly in the package body without declaring in the
package specification?
Yes
24. What is Trigger?
Trigger is a PL/SQL block when ever an event occurs it will fire.
25. Can we commit inside of trigger? How to delete the Trigger? How many triggers we
can use maximum?
No - You cant Commit Inside a Trigger
Drop Trigger <Trigger Name>
12
26. What are The DML Triggers? What is diff between Row and Statement level trigger?
Insert, Update, Delete DML Trigger
Row level - For every row, when row doesnt exists it will not fire
Statement level only once
27. How to Debug PL/SQL Code?
DBMS_OUTPUT Package
28. What are the Trigger Predicates we have?
:OLD :NEW
29. What is diff between Trigger and Procedure?
It is action based
When ever we need we can call
30. What is Package Variable what is advantage?

The variable which are declared in the Package Specifications


o We can use these variables any where

31. What are the Collections?


9i features
o Nested Tables
o Varrays
o Bulkbinds
32. What is PL/SQL Table what is the advantage of that when we will use PL/SQL Table?
PL/SQL Table is nothing but a INDEX by table
33. What is Global temporary table what diff between PL/SQL table and Temporary

table?

34. What is %ROWTYPE?


It is a record type to hold the different type of data types of the particular table.
35. What is Instead of Trigger? How can u use that?
It will execute the instead of a view
If u want to perform any DML operations through complex view we can use this.
Create trigger <trigger name> instead of
36. What is mutating trigger? How can you handle this?
If Procedure contains any DML operations on the table again we will using the same

table for same operations, it will lock the table


By using Pragma Autonomous Transaction
37. What are PL/SQL table attributes?
%ROWTYPE
%TYPE

Reports6i:
1. What is Frame, Repeating frame and Anchor Objects?
Frames are used to surround other objects and protect them from being overwritten or

pushed by other objects.


Repeating frames surround all of the fields that are created for a groups columns.
Anchors are used to determine the vertical and horizontal positioning of a child object

relative to its parent.


2. What are SYSTEM Parameters?
Background, copies, currency, decimal, desformat, desname, destype, mode,

orientation, printjob, thousands.


3. What are Bind Parameter and Lexical Parameter and what is the diff?
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.


Lexical references are placeholders for text that you embed in a SELECT statement.
4. When we will use Lexical Parameters?
You can use lexical references to replace the clauses appearing after SELECT, FROM,

WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH.
5. Where we will handle the Lexical parameters?
Data Model SQL Window
6. Tell me where u has used Lexical parameters in u r exp?
7. What are the report triggers?
Before parameter form
After parameter form
Before report
Between pages
After report
.
8.

What is the sequence of triggers firing?


Before parameter form
After parameter form
Before report
Between pages
After report

9.

What is the diff between After Parameter Form and Before Report
Trigger?
The After Parameter Form trigger fires after the Runtime Parameter Form is displayed.
The Before Report trigger fires before the report is executed but after queries is parsed
and data is fetched.

What are Format and validation and action triggers?

10.

A format trigger is a PL/SQL function executed before an object is formatted. A trigger


can be used to dynamically change the formatting attributes (font and color) of the object.

Validation triggers are PL/SQL functions that are executed when parameter values are
specified on the command line and when you accept the Runtime Parameter Form.

Action triggers are PL/SQL procedures executed when a button is selected in the Runtime
Preview. The trigger can be used to dynamically call another report (drill down) or execute
any other PL/SQL.

Report trigger execute PL/SQL functions at specific times during the execution and
formatting of your report.

Group filter determines which records to include in a group. You can use the packaged
filters, First and Last, to display the first n or last n records for the group, or you can create
your own filters using PL/SQL.

11.

What is Drill down and Matrix report?


A drill-down report is actually two or more reports working together
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

12.

How to call another report from report?


By using SRW.RUN_REPORT (command_line CHAR) built in

13.

What if confine mode and Flex Mode?


When confine mode is on u cannot move the child object from its parent,
When flex mode is on u can resize the child object according to its parent.

14.

How to Define Anchor?

15.

What are SRW Packages we have?


SRW.DO_SQL (DDL &DML STMT),
SRW.RUN_REPORT,
SRW.USER_EXIT,
SRW.MESSAGE

16.

What is User Exit?


User exit is used to transfer the control from report builder to 3gl program and vice
versa.

17.

What are Formula, Summary, and Placeholder column? Difference?


A formula column performs a user-defined computation on another column(s) data
A summary column performs group functions like avg(),sum(),max() on the fields and
returns a single value.
A Place holder column is used to declare Global variables in a report
o It is empty container at compile time and holds the value at run time

18.

What is the diff between Data link and Group by?


Data links relate the results of multiple queries.

19.

What is the purpose of Between Pages trigger?


The Between Pages trigger fires before each page of the report is formatted, except the
very first page.

20.

If out put is 10 pages how many times between pages trigger will be
Fired? If cursors go from last page to first page weather the trigger
will be created?
9 times - 0 time

Forms6i:
1. When we open the form what are the triggers will be fired?
Per-form
Pre-block
Pre-record
Pre-item
When new form instance
When new block instance
When new record instance
When new item instance
2. What are trigger level? What is the sequence of triggers sequence firing? How to

override that sequence?


Form level
Block level
Item level
Firing sequence is same as form then block then item
By using override property of trigger we can change the order of hierarchy
3. What are the types of canvases we have?
Content
Stacked
Horizontal and vertical
Tab
Canvases are different pages on a window to display the item or objects.
4. What is default Canvas and diff between Stacked and Content? When we will use

stacked canvas?
Content canvas is the default canvas
We can resize the stacked canvas, stacked canvases can be operated parallel where as
content not possible,
Stacked canvas is Used to hold extra/optional items
5. How to develop Tabular forms in D2k?
Go to block property palette and change the property called number of records

displayed : user requirement

6. What is Pre-query and Post-Query trigger and what is the diff?


Pre query just fires before the query execution whereas post query fires after the query

execution and before fetching the data and post query fires for each record and pre
query fires only once.
Pre-Query Validate the current query criteria or provide additional query criteria
programmatically, just before sending the SELECT statement to the database.
Post-Query Perform an action after fetching a record, such as looking up values in
other tables based on a value in the current record. Fires once for each record fetched
into the block.
7. While developing whether tables or views? If view how to handle the Non updatable

views and how to write the code to update the views?


By using INSTEAD OFF view we can update view if view is non updatable.
8.

What are property clauses and visual attributes?


Visual attribute is an object which holds properties like font color pattern characteristics
of object
Where as property clause is having more advanced properties like consol data.
When both are applied then common properties of visual attributes Override.

9. What is diff between property clauses and visual attributes? How to call visual attributes

dynamically?
Dynamically we cannot change property clauses where as visual attributes
SET_VA_PROPERTY (
va_id
VISUALATTRIBUTE
property
NUMBER
value
VARCHAR2 );
10. Can we write the triggers on Property clause? - Yes
11. What is the diff between CALL_FORM, OPEN_FORM, and NEW_FORM?
CALL_FORM:- Runs an indicated form while keeping the parent form active.
OPEN_FORM:- Opens the indicated form, open more than one form at the same time.
NEW_FORM:- Exits the current form and enters the indicated form.
12. What are the ways we can call the report from the form?

PROCEDURE RUN_PRODUCT(
product
module

NUMBER,
VARCHAR2,

commmode
execmode
location
paramlist_name
display

NUMBER,
NUMBER,
NUMBER,
VARCHAR2,
VARCHAR2);

FUNCTION RUN_REPORT_OBJECT
( report_id REPORT_OBJECT );
13. What is the diff between PRE-FORM and WHEN-NEW-FORM-INSTANCE?
Pre-Form:-Perform an action just before Form Builder navigates to the form from

"outside" the form, such as at form startup.


When-new-form-instance:-Perform an action at form start-up. (Occurs after the PreForm trigger fires).
14. Can we create table through form if so how?
FUNCTION FORMS_DDL (create table /<statement VARCHAR2>);
15. What are the forms Parameters? How to pass parameters?
First create parameter list and use call_form or open_form or new_form.

16. What is the diff between standard procedure and form procedure?
It is stored in Database
It is stored along with form
17. What are the object groups?
An object group is a container for a group of objects. You define an object group when

you want to package related objects so you can copy or subclass them in another
module.
18. What is the difference between Library and Package?
A library is a collection of subprograms, including user-named procedures, functions,

and packages.
A package is a PL/SQL construct that groups logically related types, objects,
procedures, and functions. Packages usually have two parts, a specification and a body,
although sometimes the body is unnecessary.
Library stored in client site while package is stored in client or server site.

19. How to change form layout dynamically?


Format-triggers
20. What are the ways we can generate .FMX?
f60gen in Unix
From menu file->administrator->compile file (ctrl+t).
21. If cursor transfer from one text item to another text item then what is the trigger

sequence fire?
Key-next-item
Post-change
When-validate-item
Post-text-item
Pre-text-item
22. What are the areas we can use object groups?
An object group is a container for a group of objects. You define an object group when

you want to package related objects so you can copy or subclass them in another
module.
23. When we create Master detail form what are the triggers will gets created and at what

level and what are the names and what is the functionalities?
On-clear details-------Form level
On-populate details
(Non isolated)
On-check-delete-master-------------both are Block level
(cascade ) Pre-delete--------------Block level
24. What are the types of relation ships and what are the differences?
Join condition
Reference i.e., primary key and foreign key relationship.

Das könnte Ihnen auch gefallen