GeekInterview.com
Series: Subject: Topic:

PL/SQL Interview Questions

Showing Questions 141 - 160 of 279 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

Char(20) = 'name' varchar2(20)='name' when comparing these two values, are the spaces padded in char are considered or not? Are both values equal?

Asked By: ricky | Asked On: Sep 12th, 2007

Answered by: javedans on: Jul 8th, 2009

Spaces will be padded with y variable,its means y will store y='sudhir              ' . while x only store 6 six character...

Answered by: mosam on: May 20th, 2008

ans is both values are not equal  char(20)='name' covered in memorey areea is 20 but varchar2(20)='name' covered in memorey areea is 4 becoze char is fixed lenth char data type but varchar2 is variable lenth char data type

What is p-code and sourcecode ?

Asked By: Naresh | Asked On: Mar 3rd, 2006

Answered by: grajeshkumar82 on: Jun 9th, 2009

PCode is the parsed Code of the Procedure which is ready for
execution... This is the code that is loaded into the shared pool and
executed for you.

Answered by: g_sidhu on: Jan 31st, 2008

Source code is the Text of the procedure.It is accessed from USER_SOURCE data dictionary view.

P-code is Compiled object code which is not accessible.

Rollforward

Asked By: kondla | Asked On: Jun 30th, 2008

What is the rollforward in PL/SQL

Answered by: Madhu_Das on: May 21st, 2009

Rollforward is to Redo, as Rollback is to undo.

Answered by: goelumesh on: Jul 1st, 2008

Roll forward refers to the process Oracle goes through to apply changes contained in the redo log files (both online and archive). The database clock (as measured by the system change number) is moved...

Return statement and out parameters

Asked By: ramyaselvi16 | Asked On: Jun 26th, 2008

What are return statement and out parameter in PL/SQL function?

Answered by: Database Steve on: May 20th, 2009

Functions always return a value.

Procedures do not.

The use of IN, OUT, and IN_OUT parameters as scalar values or ref cursors is dependent on your need and overall performance not on a pseudo-standard as answered above.

Answered by: KD09714 on: Jun 28th, 2008

Function must have return statement by which it returns one value.Though we can use out parameter in function(function not getting called from select statement or DML), it is not good programming prac...

Why functions are used in Oracle ?Can functions return more than 1 values?Why procedures are used in Oracle ?What are the disadvantages of packages?What are the GLobal variables in packages?

Asked By: sandeep kelkar | Asked On: Dec 16th, 2005

Answered by: ravivenkat1234 on: Apr 28th, 2009

Functions can have multiple out Parameters one with Return Parameter and others can be IN OUT Parameter to the function. this way a function can return multiple out parameters.Eg : Function ( a in num...

Answered by: krishnaindia2007 on: May 7th, 2008

1.Functions are used to computer a value.2.Function can return more than one value using out parameter. But it is not a good practice to return more than one value in functions.3.Proced...

Explain, is it possible to have same name for package and the procedure in that package.

Asked By: sri | Asked On: Feb 25th, 2007

Answered by: samareshp on: Apr 22nd, 2009

yes its possible.

Answered by: bhushan_nemade on: Feb 26th, 2007

Yes, its possible to have same name for package and the procedure in that package.

What is an exception ? What are types of exception ?

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

 exception  is  the  error  handling  part  of  PL/SQL  block. The types are predefined and user defined. Some of predefined exceptions are.      cursor_already_open     dup_val_on_index     no_data_found    ...

Answered by: samareshp on: Apr 17th, 2009

Hi all, Exception is nothing but Error. Exception can serve as an ALERT message also. (using RAISE_APPLICATION_ERROR)There are two types of exceptions: 1> Pre-defineddefine exception (2&g...

Answered by: Lavanya Chowdary on: May 6th, 2007

Exception is nothing but error in the PL/SQL program. If any error occured in the PL/SQL program that terminates from the program. To handle that exceptions we are using exception handling part in the...

Procedure parameters

Asked By: arunnaa | Asked On: Oct 20th, 2008

What is call by value and call by reference in parameters (in, out, inout)?

Star Read Best Answer

Editorial / Best Answer

Answered by: lisha.varghese

View all answers by lisha.varghese

Member Since Nov-2008 | Answered On : Nov 16th, 2008

Three types of parameter modes

1) IN parameter mode- This mode is used to pass values to the calling module when invoked.The value of IN parameter can't be changed in the module.

2) OUT parameter mode -This mode is used to return a value to the main block.The value of OUT parameter can change anywhere in the program.

3)IN OUT parameter mode-This mode is used to pass values to the calling module and return a value to the main block.The value of IN OUT parameter can change anywhere in the program.

In Call By value ,the copy of actual parameter is passed to the formal parameter,So any changes to the formal parameter doesn't affect the actual parameter.

In Call By reference,the address of actual parameter is passed to the formal parameter,so any changes to the formal parameter will change the actual parameter also,because both of them are pointing to the same memory location.
Here  no copying is required.
 
The IN parameter is passe by reference,so we can't change the value of IN parameter inside the module,It acts as a constant,But the OUT and IN OUT parameters are passed by value,we can change the values of OUT &  IN OUT paremeters

Answered by: samareshp on: Apr 17th, 2009



In Parameter:: call by reference
OUT Parameter: call by value
IN OUT Parameter: call by value


if you use the hint NOCOPY  with OUT Parameter and IN OUT Parameter then ::: call by reference

Answered by: lisha.varghese on: Nov 16th, 2008

Three types of parameter modes1) IN parameter mode- This mode is used to pass values to the calling module when invoked.The value of IN parameter can't be changed in the module.2) OUT parameter mo...

Can I write PL/SQL block inside expection

Asked By: rajat | Asked On: Feb 9th, 2006

Answered by: samareshp on: Apr 15th, 2009

Sure, you can write plsql block inside exception.

Answered by: Rupjit Roy on: Feb 23rd, 2006

Yes you can write PL/SQL block inside exception section. Suppose you want to insert the exception detail into your error log table, that time you can write insert into statement in exception part. To ...

What are the restrictions on functions ?

Asked By: Shweta_faqs | Asked On: Jan 31st, 2006

Answered by: samareshp on: Apr 15th, 2009

Function  having a return type as Boolean ,can't be used in select statement.

Answered by: krishnaindia2007 on: May 7th, 2008

In functions we can use all three types of parametershere is a simple exampleCREATE OR REPLACE FUNCTION TEST_FUNC(A IN NUMBER, B IN OUT NUMBER,C  OUT NUMBER)  RETURN NUMBER IS   &n...

Without closing the cursor, if you want to open it what will happen. If error, get what is the error?

Asked By: ddkdhar | Asked On: Mar 1st, 2007

Answered by: msenthil19 on: Mar 18th, 2009

Error will be like "Cursor already open"

Answered by: ratna82 on: Oct 10th, 2008

CURSOR_ALREADY_OPEN ORA-06511 An attempt was made to open a cursor that was already open.

Debug pl SQL

Asked By: ramyaselvi16 | Asked On: Jun 20th, 2008

How can we generate debugging output from PL/SQL?

Answered by: kperumal75 on: Feb 24th, 2009

Use "SHOW ERRORS" command.

Regards,
Karthik

Answered by: KD09714 on: Jun 28th, 2008

stshekhar is right,

oracle supplied package DBMS_OUTPUT with procedures PUT, PUT_LINE, NEW_LINE etc in case of debugging pl/sql

About DBMS_output.Put_line( ) package

Asked By: usrkraju | Asked On: Jul 17th, 2008

What is the maximum size of the message that we can give in DBMS_output.Putline();

Answered by: kantri on: Dec 15th, 2008

The maximum size of package is 32k
We can't give  more than that

Answered by: jp_valapad on: Aug 5th, 2008

255 bytes was the size limits of earlier version of oracle..ie prior to 10 g ..in 10g 32767 byte is the limit..

What is pragma restrict_references:

Asked By: ddkdhar | Asked On: Mar 1st, 2007

Answered by: saishradha on: Dec 3rd, 2008

Pragma RESTRICT_REFERENCES is a compiler directive.
It makes sure that the function maintains the purity rules and code in fuction creation satisfy the purity rules.
There are 4 values for it.
WNDS,RNDS,WNPS,RNPS.

Thanks
Jai Sainath

Answered by: Kullai Naidu on: Mar 5th, 2007

By using pragma_restrict_references we can  give the different status to functions,Like WNDB(WRITE NO DATA BASE),RNDB(read no data base),Write no package state,read no packge state.W

What is the difference between in, out, inout parameters. Can we pass value or reference or both to the in out parameter.

Asked By: sbagai2001 | Asked On: May 26th, 2006

Answered by: saishradha on: Nov 26th, 2008

Here is the answer in 1 lineIN-- value is used in a program.       It cannot be a variable .COuld be literal,expression,value .OUT-- value is returned back from the progr...

Answered by: raghav_sy on: Jan 15th, 2007

hi friends,To make it simple, keep in mind,IN : It is a CONSTANT in the sub-program and u can not modify its value in sub-      program. if its value is modified in the s...

Suppose, i've created a new database db1 n i've created a table db1.T1.Now, desc t1 --> desplaying the table structure butselect * from db1.T1 ---->giving--> table or view does not exist.. Can any one...

Asked By: shamim909 | Asked On: Oct 17th, 2006

Answered by: todeepakmalhotra on: Nov 10th, 2008

You cannot use the database name before the table name like db1.t1.we can only use a user name and then table name. eg. let we have a user "deepak" then we can write select * from deepak.t1 .  We ca...

Answered by: oozaifa on: Nov 6th, 2008

Type schema name before table name or your id dont have the access to view the data from that table

Is the order in which the conditions are given in the 'where' clause are important?

Asked By: babhatti | Asked On: Jul 16th, 2008

Mean I heard from Oracle 8i onwards the order of where clause condition does not matter which Oracle creates the explain plan...And execute..Is it true?

Answered by: manoj_behera82 on: Aug 7th, 2008

Yes the order is important. But it is important for the performance of the query and not for the final result. The output of the query will be the same irrespective of the order in which the join con...

Answered by: gtomar on: Aug 7th, 2008

Hi,

Where Clause conditions execution are independent of order in explain plan but it reads top to bottom.

Thanks,
Gunjan

In PL/SQL if we write select statement with into clause it may return two exceptions no_data_found or too_many_row . To do you avoid these execeptions. How do you write SQL statement in alternative way?

Asked By: ddkdhar | Asked On: Mar 1st, 2007

Answered by: vnraos on: Sep 5th, 2008

First, let us understand why these errors cropup.1) NO_DATA_FOUND - is raised only for "select into" statements when  the where clause of the query does not match any rows.2)TOO_MANY_rows - is raised...

Answered by: binurajnair on: Jul 30th, 2008

If you don't want an excpetion to be raised on a SELECT statement, you can avoid executing the statement by having a count just before the SELECT as shown belowSELECT count(rowid)into v_count from...

How to reduce the the burden/main memory on database if I am using refcursor to hold large data to increase performance.

Asked By: monu | Asked On: May 25th, 2007

Answered by: durgadas.menon on: Aug 13th, 2008

Unlike tables ref cursors do not store data. They act like mold to hold data during the execution of the piece of code so proper coding and use of bind variables can help decrease the burden of proces...

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.