Earn Money (Scholarships) By Posting Useful Content at our Forum |
|
Category Articles
What are SQLCODE and SQLERRM and why are they important for PL/SQL developers?
Added on Fri, Jan 8, 2010
SQLCODE returns the value of the error number for the last error encountered. The SQLERRM returns the actual error message for the last error encountered. They can be used in exception handling to report, or, store in an error log table, the error... Read More
Which of the following statements is true about implicit cursors?
Added on Fri, Jan 8, 2010
1. Implicit cursors are used for SQL statements that are not named. 2. Developers should use implicit cursors with great care. 3. Implicit cursors are used in cursor for loops to handle data processing. 4. Implicit cursors are no longer a... Read More
Describe the use of %ROWTYPE and %TYPE in PL/SQL
Added on Fri, Jan 8, 2010
Level: Low Expected answer: %ROWTYPE allows you to associate a variable with an entire table row. The %TYPE associates a variable with a single column type. Read More
What is the maximum number of handlers processed before the PL/SQL block is exited when an exception occurs?
Added on Fri, Jan 8, 2010
1. Only one 2. All that apply 3. All referenced 4. None Read More
How can you generate debugging output from PL/SQL?
Added on Fri, Jan 8, 2010
Use the DBMS_OUTPUT package. Another possible method is to just use the SHOW ERROR command, but this only shows errors. The DBMS_OUTPUT package can be used to show intermediate results from loops and the status of variables as the procedure is... Read More
Describe the difference between a procedure, function and anonymous pl/sql block.
Added on Fri, Jan 8, 2010
Candidate should mention use of DECLARE statement, a function must return a value while a procedure doesn't have to. Read More
Describe the use of PL/SQL tables
Added on Fri, Jan 8, 2010
PL/SQL tables are scalar arrays that can be referenced by a binary integer. They can be 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. Read More
PL/SQL offers which collection types?
Added on Fri, Jan 8, 2010
1.Index-by tables, 2.Nested tables 3.Varrays Read More
What are the types of triggers?
Added on Fri, Jan 8, 2010
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. Read More
Why PL/SQL does not support retriving multiple records?
Added on Fri, Jan 8, 2010
Multiple records at a time could be retreved in PL/ SQL using BULK COLLECT. To do that you define PL/ SQL table and load it using SELECT ... BULK COLLECT INTO <pl/ sql table> FROM .. Optionaly could be used LIMIT - to limit the number... Read More
What is difference between % ROWTYPE and TYPE RECORD ?
Added on Fri, Jan 8, 2010
% 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 different table or views and variables. E.g. TYPE r_emp is RECORD (eno emp.empno% type,ename emp... Read More
what is the difference between an explicit cursor and select into statement?
Added on Fri, Jan 8, 2010
Explicit cursors are those user defined cursors in order to retrive more than one row from a table. Select into statment helps in invoking parmeters into the formal parameters. Read More
Which Oracle supplied package can you use to output values and messages from database triggers, stored procedures and functions within SQL*Plus
Added on Fri, Jan 8, 2010
1. DBMS_DISPLAY 2. DBMS_OUTPUT 3. DBMS_LIST 4. DBMS_DESCRIBE Read More
How can you find within a PL/SQL block, if a cursor is open?
Added on Fri, Jan 8, 2010
Use the %ISOPEN cursor status variable. Read More
When is a declare statement needed ?
Added on Fri, Jan 8, 2010
The DECLARE statement is used in PL/SQL anonymous blocks such as with stand alone, non-stored PL/SQL procedures. It must come first in a PL/SQL stand alone file if it is used. Read More
Which of the following is not a feature of a cursor FOR loop?
Added on Fri, Jan 8, 2010
1. Record type declaration. 2. Opening and parsing of SQL statements. 3. Fetches records from cursor. 4. Requires exit condition to be defined. Read More
In what order should a open/fetch/loop set of commands in a PL/SQL block be implemented if you use the NOTFOUND cursor variable in the exit when statement? Why
Added on Fri, Jan 8, 2010
OPEN then FETCH then LOOP followed by the exit when. If not specified in this order will result in the final return being done twice because of the way the %NOTFOUND is handled by PL/ SQL. Read More
When is a declare statement needed
Added on Fri, Jan 8, 2010
The DECLARE statement is used in PL/ SQL anonymous blocks such as with stand alone, non-stored PL/SQL procedures. It must come first in a PL/SQL stand alone file if it is used. Read More
What packages (if any) has Oracle provided for use by developers?
Added on Fri, Jan 8, 2010
Oracle provides the DBMS_ series of packages. There are many which developers should 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... Read More
In what order should a open/fetch/loop set of commands in a PL/SQL block be implemented if you use the NOTFOUND cursor variable in the exit when statement? Why?
Added on Fri, Jan 8, 2010
OPEN then FETCH then LOOP followed by the exit when. If not specified in this order will result in the final return being done twice because of the way the %NOTFOUND is handled by PL/SQL. Read More
Which set of statements will successfully invoke this function within SQL*Plus?
Added on Fri, Jan 8, 2010
1. VARIABLE g_yearly_budget NUMBER EXECUTE g_yearly_budget := GET_BUDGET(11); 2. VARIABLE g_yearly_budget NUMBER EXECUTE :g_yearly_budget := GET_BUDGET(11); 3. VARIABLE :g_yearly_budget NUMBER EXECUTE :g_yearly_budget := GET_BUDGET(11); 4.... Read More
What packages (if any) has Oracle provided for use by developers
Added on Fri, Jan 8, 2010
Oracle provides the DBMS_ series of packages. There are many which developers should 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... Read More
What is a mutating table error and how can you get around it?
Added on Fri, Jan 8, 2010
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 while updating the other. Read More
|
|