Wednesday 7 May 2014

HCL PL/SQL Interview Questions

 

What is the physical and logical structure of oracle
PHYSICAL: DATAFILES,CONTROL FILES,REDO LOG FILES
Logical: TABLESPACE, SEGMENTS,EXTENTS,DATABLOCKS
How can u open multiple files in Unix  is it possible.
VI file1 file2 file3
How can u  connect from Unix to database is there any login or password.
Sqlplus
Enter password : / as sysdba
What is the version u are using.
Oracle 9i
When u create a table tablespace is created what is tablespace
System tablespace
What is the syntax of procedures.
CREATE OR REPLACE PROCEDURE procedure_name( arg  in type ……) is
What is overloading.
Function or procedure with same name but different no/types of parameter
Created procedure has 5 parameters if the same procedure is called with 3 parameters will it work? What is the error will it give?
NO, It will give error as -------à WRONG NUMBER OR TYPES OF ARGUMENT CALLS IN CALL TO ‘PROCEDURE’
How many types of cursors  are there.
2 types
Implicit cursor
Explicit cursor
What are the attributes of cursors in explicit & implicit.
For explicit                                                For implicit
Cursor_name%ISOPEN                           SQL%ISOPEN
Cursor_name%FOUND                           SQL%NOTFOUND
Cursor_name%NOTFOUND                   SQL%FOUND
Cursor_name%ROWCOUNT                  SQL%ROWCOUNT
How does u open loop for cursors?
OPEN  cursor_name;
How can u select data into variables using select command
SELECT  COLUMNS INTO VARIABLES  FROM TABLE_NAME;
If where condition is not  specified  what error it will give how do u handle that error , what is the exception  pre_defined exception u use.
Ans: too_many_rows.
What is %rowtype how do u declare it in plsql block write it.
It is used to define the data types of an entire row
Name  ename%rowtype
What is the structure of plsql block
[DECLARE]


BEGIN
….

[EXCEPTION]



END;