Académique Documents
Professionnel Documents
Culture Documents
www.askhareesh.com /2014/05/plsql-interview-questions-part3.html
1/4
2/4
Ans: Parsing : Parsing is the process of: 1. Translating a SQL statement, verifying it to be a valid statement 2.
Performing data dictionary lookups to check table and column definitions 3. Acquiring parse locks on required
objects so that their definitions do not change during the statement's parsing 4. Checking privileges to access
referenced schema objects 5. Determining the execution plan to be used when executing the statement 6.
Loading it into a shared SQL area 7. For distributed statements, routing all or part of the statement to remote
nodes that contain referenced data
48.What is a HINT and what are types HINT?
Ans: Hints are suggestions that you give the optimizer for optimizing a SQL statement. Hints allow you to make
decisions usually made by the optimizer.
TYPES OF HINTS :
ALL_ROWS : The ALL_ROWS hint explicitly chooses the cost-based approach to optimize a statement block
with a goal of best throughput.
FIRST_ROWS : The FIRST_ROWS hint explicitly chooses the cost-based approach to optimize a statement
block with a goal of best response time.
FULL : The FULL hint explicitly chooses a full table scan for the specified table.
ROWID : The ROWID hint explicitly chooses a table scan by ROWID for the specified table.
CLUSTER : The CLUSTER hint explicitly chooses a cluster scan to access the specified table.
HASH : The HASH hint explicitly chooses a hash scan to access the specified table.
INDEX : The INDEX hint explicitly chooses an index scan for the specified table.
AND_EQUAL: The AND_EQUAL hint explicitly chooses an execution plan that uses an access path that merges
the scans on several single-column indexes. (You can specify multiple indexes through this hint) INDEX_ASC:
The INDEX_ASC hint explicitly chooses an index scan for the specified table. If the statement uses an index
range scan, ORACLE scans the index entries in ascending order of their indexed values.
INDEX_DESC: The INDEX_DESC hint explicitly chooses an index scan for the specified table. If the statement
uses an index range scan, ORACLE scans the index entries in descending order of their indexed values.
ORDERED : The ORDERED hint causes ORACLE to join tables in the order in which they appear in the FROM
clause.
USE_NL : The USE_NL hint causes ORACLE to join each specified table to another row source with a nested
loops join using the specified table as the inner table.
USE_MERGE : The USE_MERGE hint causes ORACLE to join each specified table with another row source
with a sort-merge join.
49.What do u mean by EXCEPTION_INIT Pragma ?
Ans: EXCEPTION_INIT Pragma : To handle unnamed internal exceptions, you must use the OTHERS handler
or the pragma EXCEPTION_INIT. A "pragma" is a compiler directive, which can be thought of as a parenthetical
remark to the compiler. Pragmas (also called "pseudoinstructions") are processed at compile time, not at run
time. They do not affect the meaning of a program; they simply convey information to the compiler. The
predefined pragma EXCEPTION_INIT tells the PL/SQL compiler to associate an exception name with an Oracle
error number. That allows you to refer to any internal exception by name and to write a specific handler for it. You
code the pragma EXCEPTION_INIT in the declarative part of a PL/SQL block, subprogram, or package
using the syntax PRAGMA EXCEPTION_INIT(exception_name, Oracle_error_number); where
3/4
"exception_name" is the name of a previously declared exception. For internal exceptions, SQLCODE returns
the number of the associated Oracle error. The number that SQLCODE returns is negative unless the Oracle
error is "no data found," in which case SQLCODE returns +100. SQLERRM returns the message associated
with the Oracle error that occurred. The message begins with the Oracle error code. For user-defined
exceptions, SQLCODE returns +1 and SQLERRM returns the message User-Defined Exception unless you
used the pragma EXCEPTION_INIT to associate the exception name with an Oracle error number, in which case
SQLCODE returns that error number and SQLERRM returns the corresponding error message. The maximum
length of an Oracle error message is 512 characters including the error code, nested messages, and message
inserts such as table and column names.
What do u mean by JSP query?
Ans: JSP Query : The JSP Query is a standard query for number to words conversion, used especially for
converting amount in number into equivalent amount in words. The query is as follows : Select to_char ( to_date
( &no, J ), JSP ) words from dual; For eg : Select to_char ( to_date ( '23949','j' ), 'JSP' ) "words" from dual; The
value that can pass to &no cannot exceed 7 digits.
50.Describe Oracle databases physical and logical structure ?
Ans: Physical: Data files, Redo Log files, Control file. Logical : Tables, Views, Tablespaces, etc.
Part1
Part2
Part3
Part4
Part5
4/4