Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
9Activity
0 of .
Results for:
No results containing your search query
P. 1
Tech Mahendra pl/sql oracle questions

Tech Mahendra pl/sql oracle questions

Ratings:
(0)
|Views: 425|Likes:
Published by hiram_786
some of my best knowledge
some of my best knowledge

More info:

Published by: hiram_786 on Apr 15, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

01/04/2014

pdf

text

original

 
 
PL/SQL Questions:
 
Describe the difference between a procedure, function and anonymous pl/sql block.Candidate should mention use of DECLARE statement, a function must return a value while a proceduredoesn?t have to.
 
What is a mutating table error and how can you get around it?This happens with triggers. It occurs because the trigger is trying to update a row it is currently using.The usual fix involves either use of views or temporary tables so the database is selecting from one whileupdating the other.
 
Describe the use of %ROWTYPE and %TYPE in PL/SQLExpected answer: %ROWTYPE allows you to associate a variable with an entire table row. The %TYPEassociates a variable with a single column type.
 
4What packages (if any) has Oracle provided for use by developers?Expected answer: Oracle provides the DBMS_ series of packages. There are many which developersshould be aware of such as DBMS_SQL, DBMS_PIPE, DBMS_TRANSACTION, DBMS_LOCK, DBMS_ALERT,DBMS_OUTPUT, DBMS_JOB, DBMS_UTILITY, DBMS_DDL, UTL_FILE. If they can mention a few of theseand describe how they used them, even better. If they include the SQL routines provided by Oracle,great, but not really what was asked.
 
Describe the use of PL/SQL tablesExpected answer: PL/SQL tables are scalar arrays that can be referenced by a binary integer. They canbe used to hold values for use in later queries or calculations. In Oracle 8 they will be able to be of the%ROWTYPE designation, or RECORD.
 
 
 
When is a declare statement needed ?The DECLARE statement is used in PL/SQL anonymous blocks such as with stand alone, non-storedPL/SQL procedures. It must come first in a PL/SQL stand alone file if it is used.
 
In what order should a open/fetch/loop set of commands in a PL/SQL block be implemented if you usethe %NOTFOUND cursor variable in the exit when statement? Why?Expected answer: OPEN then FETCH then LOOP followed by the exit when. If not specified in this orderwill result in the final return being done twice because of the way the %NOTFOUND is handled byPL/SQL.
 
What are SQLCODE and SQLERRM and why are they important for PL/SQL developers?Expected answer: SQLCODE returns the value of the error number for the last error encountered. TheSQLERRM returns the actual error message for the last error encountered. They can be used in exceptionhandling to report, or, store in an error log table, the error that occurred in the code. These are especiallyuseful for the WHEN OTHERS exception.
 
How can you find within a PL/SQL block, if a cursor is open?Expected answer: Use the %ISOPEN cursor status variable.
 
How can you generate debugging output from PL/SQL?Expected answer: Use the DBMS_OUTPUT package. Another possible method is to just use the SHOWERROR command, but this only shows errors. The DBMS_OUTPUT package can be used to showintermediate results from loops and the status of variables as the procedure is executed. The newpackage UTL_FILE can also be used.
 
 
What are the types of triggers?Expected Answer: There are 12 types of triggers in PL/SQL that consist of combinations of the BEFORE, AFTER, ROW, TABLE, INSERT, UPDATE, DELETE and ALL key words:
 
BEFORE ALL ROW INSERT
 
 AFTER ALL ROW INSERT
 
BEFORE INSERT
 
 AFTER INSERT etc.
 Where is the WHERE CURRENT OF clause required in cursors?Where do we store the features of package, procedure and functions?Discuss the cursor attributes available in pl/sql.Explain forward declaration used in functions.If we call a column updating procedure in the database trigger of the same table?Explain the two virutal tables which are used while execution of database.Explain the difference between Function and Procedure.What do you understand by a Raise_application_error?Explain the various types of database triggers possible on a table.What do you mean by ref cursor?Describe the method of calling functions and procedures in a PL/SQL block.What do you understand by Trigger, function, cursor in pl-sql?Are the Rollback or Commit Transaction Control Statements useful in Database Trigger?Explain the various uses and limitations of cursor.What are the constituents of a package?Describe the basic structure of PL/SQL.Method of dubugging the procedure.

Activity (9)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
kmufasa liked this
kmufasa liked this
ashok2009cs liked this
ALi liked this
deshantori liked this
Amit Kasana liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->