Set - 6

Question 31 :

How you were passing cursor variables in PL/SQL 2.2?

Answer :

In PL/SQL 2.2 cursor variables cannot be declared in a package.This is because the storage for a cursor variable has to be allocated using Pro*C or OCI with version 2.2, the only means of passing a cursor variable to a PL/SQL block is via bind variable or a procedure parameter.

Question 32 :

When do you use WHERE clause and when do you use HAVING clause?

Answer :

HAVING clause is used when you want to specify a condition for a group function and it is written after GROUP BY clause. The WHERE clause is used when you want to specify a condition for columns, single row functions except group functions and it is written before GROUP BY clause if it is used.

Question 33 :

Difference between procedure and function.?

Answer :

Functions are named PL/SQL blocks that return a value and can be called with arguments procedure a named block that can be called with parameter. A procedure all is a PL/SQL statement by itself, while a Function call is called as part of an expression.

Question 34 :

Which is more faster - IN or EXISTS?

Answer :

EXISTS is more faster than IN because EXISTS returns a Boolean value whereas IN returns a value.

Question 35 :

What is syntax for dropping a procedure and a function .Are these operations possible?

Answer :

Drop Procedure procedure_name
Drop Function function_name