CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.




Get it now !!
Send your Resume to 6000 Companies
PL/SQL Interview Questions & Answers - Learning Mode
COOLINTERVIEW.COM DATABASE INTERVIEW QUESTIONS PL/SQL INTERVIEW QUESTIONS QUESTIONS & ANSWERS - LEARNING MODE

PL/SQL Interview Questions & Answers - Learning Mode

PL/SQL is a combination of SQL along with the procedural features of programming languages. It was developed by Oracle Corporation in the early 90?s to enhance the capabilities of SQL. PL/SQL program units are compiled by the Oracle Database server and are stored inside the database.

Try PL/SQL Interview Questions & Answers - Exam Mode

1 2 Next

Sort By : Latest First | Oldest First | By Rating

PL/SQL Interview Questions & Answers - Learning Mode
Try PL/SQL Interview Questions & Answers - Exam Mode
Question: What packages (if any) has Oracle provided for use by developers?

Answer: 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 of these and describe how they used them, even better. If they include the SQL routines provided by Oracle, great, but not really what was asked. Source: CoolInterview.com
Question: Which of the following statements is true about implicit cursors?

Answer: 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 feature in Oracle. Source: CoolInterview.com
Question: What are SQLCODE and SQLERRM and why are they important for PL/SQL developers?

Answer: 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 that occurred in the code. These are especially useful for the WHEN OTHERS exception. Source: CoolInterview.com
Question: Describe the difference between a procedure, function and anonymous pl/sql block.

Answer: Candidate should mention use of DECLARE statement, a function must return a value while a procedure doesn't have to. Source: CoolInterview.com
Question: Which of the following is not a feature of a cursor FOR loop?

Answer: 1. Record type declaration.
2. Opening and parsing of SQL statements.
3. Fetches records from cursor.
4. Requires exit condition to be defined. Source: CoolInterview.com
Question: How can you generate debugging output from PL/SQL?

Answer: 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 executed. The new package UTL_FILE can
also be used. Source: CoolInterview.com
Question: What is the maximum number of handlers processed before the PL/SQL block is exited when an exception occurs?

Answer: 1. Only one
2. All that apply
3. All referenced
4. None Source: CoolInterview.com
Question: What is a mutating table error and how can you get around it?

Answer: 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. Source: CoolInterview.com
Question: What are the types of triggers?

Answer: There are 12 types of triggers in PL/SQL that consist of<br>combinations of the BEFORE, AFTER, ROW, TABLE, INSERT, UPDATE, DELETE and<br>ALL key words:<br>BEFORE ALL ROW INSERT<br>AFTER ALL ROW INSERT<br>BEFORE INSERT<br>AFTER INSERT etc. Source: CoolInterview.com
Question: If we have procedureS A and B in a package. procedure B is reffered in other subprogram. Updates to procedure A in a package, will do recompilation does this effect the other procedure B reffered in other subprogram. please let me know the details about the packages.

Answer: No answer available currently.
Question: Describe the use of %ROWTYPE and %TYPE in PL/SQL

Answer: %ROWTYPE allows you to associate a variable with an entire table row. The %TYPE associates a variable with a single column type. Source: CoolInterview.com
Question: Describe the use of PL/SQL tables

Answer: 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. Source: CoolInterview.com
Question: 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?

Answer: 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. Source: CoolInterview.com
Question: what is the difference between an explicit cursor and select into statement?

Answer: 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. Source: CoolInterview.com
Question: How can you generate debugging output from PL/SQL?

Answer: Use the DBMS_OUTPUT package. The DBMS_OUTPUT package can be used to show intermediate results from loops and the status of variables as the procedure is executed, however output only occurs after processing is finished, which might not be useful if processing takes a long time. The package UTL_FILE can be used to write to a file, but one must have write access to the output directory. A third possibility is to create a log table and have the procedure write to the table. This will give you debug Source: CoolInterview.com
Question: What are the types of triggers?

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. Source: CoolInterview.com
Question: What are SQLCODE and SQLERRM and why are they important for PL/SQL developers?

Answer: 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 that occurred in the code. These are especially useful for the WHEN OTHERS exception. Source: CoolInterview.com
Question: What is a mutating table error and how can you get around it?

Answer: 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. Source: CoolInterview.com
Question: Can we assign value to IN parameter inside a pl sql procedure?

Answer: IN parameter is a read only parameter. We can assign the value of IN type parameter to a variable or use it in a query, but we cannot change its value inside the procedure. Source: CoolInterview.com
Question: What is a mutating table error and how can you get around it?

Answer: 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. Source: CoolInterview.com

1 2 Next



India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
Cache = 0 Seconds