GeekInterview.com
Series: Subject: Topic:

PL/SQL Interview Questions

Showing Questions 1 - 20 of 279 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

Oracle joins

Asked By: sidd_130 | Asked On: Oct 6th, 2012

There are 2 tables, a and b having 3 rows each. What will be result on executing the following query? : SQL> select * from a,b

Answered by: jiley singh on: May 21st, 2013

9 rows will be retreive

Answered by: CHALAM on: Apr 15th, 2013

Cross join. Total 9 records will come

Can anybody tell me a sample oci function which will be able to call from tourbo cthanx!!

Asked By: Nitina | Asked On: Jun 22nd, 2006

Answered by: rajkumar1237 on: Apr 27th, 2013

OCI means::oracle call interface.is a interface api used to access oracle database from C programs. Data Guard stands for it is multiple DB servers environment configured for Physical as well as Logic...

What is difference between % rowtype and type record ?

Asked By: Interview Candidate | Asked On: Sep 9th, 2004

 %  rowtype  is to be used whenever query returns a entire row of a table or view. type  rec  record is to be used whenever query returns columns of differenttable or views and variables.      e.G.  type  r_emp is record (eno emp.Empno%...

Answered by: m.ajantha on: Apr 15th, 2013

row type is used to hold the total row values

Answered by: rayavarapu on: Jan 23rd, 2013

%rowtype:- %rowtype means it is will fetch entire row values.

Type record: Type record means we can fetch record from more than one table.

Copying data across tables

Asked By: sidd_130 | Asked On: Oct 6th, 2012

In what ways can data be copied from one table to another?

Answered by: Neeraj Saxena on: Apr 12th, 2013

You can copy the data from one table to another with the help of below Query:

Suppose dummy is the main table and we need to copy the data from dummy_120413 table.

Create tabel dummy_120413 as Select * from dummy;

Debugging PL/SQL programs

Asked By: sidd_130 | Asked On: Oct 6th, 2012

How can we debug stored procedures in PL/SQL?

Answered by: Ali on: Apr 9th, 2013

use following dbms package to get error line no in oracle 11g:

dbms_utility.format_error_backtrace

Answered by: srikanth goduru on: Oct 10th, 2012

Using dbms_ouptput.put_line and logging different parts of the procedure.

Where would you use implicit & explicit cursors?

Asked By: sai | Asked On: Nov 24th, 2011

Answered by: anonymous on: Apr 4th, 2013

An implicit cursor is one created "automatically" for you by Oracle when you execute a query. It is simpler to code, but suffers from inefficiency (the ANSI standard specifies that it must fetch twic...

Answered by: rayavarapu on: Jan 23rd, 2013

Implicit Cursor:- It is Oracle pre-defined type.. when we fetch only one record then we need to use implicit cursor.

Explicit cursor:- It is user defined cursor.. when we need to fetch more the one records we need to use explicit cursor..

Transaction management in triggers

Asked By: sidd_130 | Asked On: Oct 6th, 2012

Can we give commit or rollback within a trigger?

Answered by: rocky on: Mar 16th, 2013

Using pragma autonomous_transaction we can use the commit and rollback.

Answered by: Arun on: Oct 16th, 2012

Although you cant give commit or rollback in trigger directly, still there are ways to give them
You can use the autonomus transactions to do that

Stored procedure vs function

Asked By: priyanka_sharma | Asked On: Sep 20th, 2012

What is the impact of using a stored proc or a function on the performance? Which has a better performance? Also, why is it not possible to use dml in the functions called from a select query?

Answered by: kritika kulshrestha on: Feb 19th, 2013

Implicit cursor is created automatically,opened automatically and closed automatically.it holds exactly one record. in case none or more than 1 record are retrieved, an exception is raised and that re...

Answered by: Miguel on: Nov 2nd, 2012

A function is a store procedure indeed, and you can use autonomous transactions to do some DML

What is the data type of null?

Asked By: Ramakrishnan | Asked On: Jun 1st, 2006

Answered by: rayavarapu on: Jan 23rd, 2013

Null is not a value and not a string. It is unknown it is maximum in descending order and minimum value in ascending order.

Answered by: Sandeep on: Mar 7th, 2012

char(0)

What is difference between a procedure & function ?

Asked By: Interview Candidate | Asked On: Sep 2nd, 2005

 a function is always returns a value using the return statement.        a  procedure   may  return one or more values through parameters or may not return at all.

Star Read Best Answer

Editorial / Best Answer

Answered by: krishnaindia2007

View all answers by krishnaindia2007

Member Since Sep-2007 | Answered On : May 3rd, 2008

1. Function is mainly used in the case where it must return a value. Where as a procedure may or may not return a value or may return more than one value using the OUT parameter.
 
2. Function can be called from SQL statements where as procedure can not be called from the sql statements

3. Functions are normally used for computations where as procedures are normally used for executing business logic.

4. You can have DML (insert,update, delete) statements in a function. But, you cannot call such a function in a SQL query.

5. Function returns 1 value only. Procedure can return multiple values (max 1024).

6.Stored Procedure: supports deferred name resolution. Example while writing a stored procedure that uses table named tabl1 and tabl2 etc..but actually not exists in database is allowed only in during creation but runtime throws error Function wont support deferred name resolution.

7.Stored procedure returns always integer value by default zero. where as function return type could be scalar or table or table values

8. Stored procedure is precompiled execution plan where as functions are not.
 
9.A procedure may modify an object where a function can only return a value The RETURN statement immediately completes the execution of a subprogram and returns control to the caller.

Answered by: Md Jamshaid on: Dec 26th, 2012

What is the difference between system procedure and system function?.

Answered by: Swapnil on: Oct 31st, 2012

Also Procedure can be called from triggers but Function cannot be called from trigger. As function returns value. And no value can be returned to trigger.

Bulk binding

Asked By: sidd_130 | Asked On: Oct 6th, 2012

What are the advantages of bulk binding in PL/SQL?

Answered by: Mylo on: Dec 15th, 2012

Bulk binding reduces the context switches between SQL and pl/SQL engines. It enhances the performance but thr memory consumption would be high.

Difference between truncate and delete

Asked By: rojalina begum | Asked On: Jun 9th, 2006

Answered by: Hasan on: Dec 15th, 2012

truncate is a ddl...delete is dml
cannot rollback data in truncate...rollback data in delete
truncate -delete entire data not structure...it delete specific datas

Answered by: VASU on: Oct 20th, 2012

By using delete we have to delete particular records only..
If we use truncate we cannot retrieve the data permanently...

Autonomous transactions

Asked By: sidd_130 | Asked On: Oct 6th, 2012

What is an autonomous transaction?

Answered by: Sonal on: Nov 7th, 2012

The AUTONOMOUS_TRANSACTION pragma changes the way a subprogram works within a transaction. A subprogram marked with this pragma can do SQL operations and commit or roll back those operations, without ...

Answered by: VASU on: Oct 20th, 2012

BY USING AUTONOMOUS TRANSACTION
WE GET THE FOLLOWING ADVANTAGES
WE PROCEDURE HAVING TRANSACTIONS STATEMENTS WE CALL PROCEDURE AUTOMATICALLY EFFECT THE ABOVE TRANSACTIONS ALSO TO OVERCOME THAT PROBLEM WE HAVE TO USE AUTONOMOUS TRANSACTION..

Oracle collections

Asked By: sidd_130 | Asked On: Oct 6th, 2012

What are the types of collection in PL/SQL? What is the advantage of nested tables?

Answered by: pawan on: Nov 6th, 2012

Varrays,nested tables,index by tables are oracle collection.Index by tables also known as associative array similar to hashtables in java. Varrays are like arrays in java static in nature need to d...

What is the use of nocopy parameter in Oracle procedure

Asked By: ily_saravanan | Asked On: Mar 19th, 2007

Hi, what is nocopy parameter in Oracle procedure. What is the use of it. In which situation,we can use the nocopy parameter.Thanks,saravanan.P

Answered by: Himansu on: Nov 6th, 2012

In procedure,Function there are three types of parameter is there. eg-IN, OUT, INOUT. IN parameter is call by reference and OUT & INOUT are call by value. Always call by reference is faster than call ...

Answered by: Saket on: Apr 3rd, 2012

Pass by reference: "IN" Case
Pass by value : "Out" or "IN OUT" Case which have the overhead of copying the value to new procedure parameter.
In order to make to Pass by reference we will use NOCOPY
Pass by reference: "OUT NOCOPY" or "IN OUT NOCOPY" which deals which the actual reference value.

State the difference between implict and explict cursor's

Asked By: senthil | Asked On: Jul 25th, 2006

Answered by: chiatanya on: Nov 5th, 2012

Implicit cursors are automatically generated,when a sql statement is processed where as

Explicit cursors are user defined.

Answered by: VASU on: Oct 20th, 2012

Implicit cursors returns only single record..where as explicit cursor multiple records. But it process record by record.

Dropping a type in Oracle

Asked By: sidd_130 | Asked On: Oct 6th, 2012

Can a type body be dropped without dropping the type specification?

Answered by: ramya on: Oct 31st, 2012

When you drop a type body, the object type specification still exists, and you can re-create the type body. Prior to re-creating the body, you can still use the object type, although you cannot call the member functions.

Oracle locks

Asked By: sidd_130 | Asked On: Oct 6th, 2012

With what ways can we find out instance locks?

Answered by: Jose George on: Oct 22nd, 2012

v$lock contains details of locks

What is a cursor for loop ?

Asked By: Interview Candidate | Asked On: Sep 9th, 2004

 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 closeswhen all the records have been processed.      eg. For emp_rec in c1 loop         ...

Answered by: vasu on: Oct 20th, 2012

Cursor for loop is the one by using this we need not to perform open, close, fetch operations of a cursor..

Answered by: PRADEEP on: Oct 17th, 2012

If we use explicit cursor we need to open the cursor and fetching the data and close the cursor.

If we use cursor for loop cursor will open the cursor and fetching data and close the cursor automatically.

Populating tables in Oracle 11g

Asked By: Dany Wells | Asked On: Nov 9th, 2011

How do you populate tables or data in Oracle 11g step by step?

Answered by: Jose George on: Oct 17th, 2012

We can use SQL Loader too

Answered by: Jose George on: Oct 16th, 2012

Depending on the situation one can use
external tables
or
UTL_FILE package

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.