This action might not be possible to undo. Are you sure you want to continue?
questions will be updated and new questions will be added on regular basis , so stay tuned and subscribe to RSS Feed. What special operators does Oracle provide for dealing with NULLs? NVL - Converts a NULL to another specified value, as in: my_var := NVL (your_var, 'Hello'); IS NULL and IS NOT NULL You can use this syntax to check specificaly to see if a variable's value is NUL L or NOT NULL. Explain three different rules that apply to NULLs when doing comparisons? 1. For all operators except for concatenation (||), if a value in an expression is a NULL, that expression evaluates to NULL 2. NULL is never equal or not equal to another value 3. NULL is never TRUE or FALSE What command would you use to encrypt a PL/SQL application? WRAP Explain the difference between a FUNCTION, PROCEDURE and PACKAGE. A function has a return type in its specification and must return a value specif ied in that type. A procedure does not have a return type in its specification and should no t return Oracle SQL & PL/SQL Oracle SQL SQL Introduction SQL Syntax SQL Select SQL Insert SQL Update SQL Delete SQL Joins SQL Examples of Joins SQL Explicit vs. Implicit Joins SQL Group By SQL Group By Examples SQL Having SQL - IN SQL - NULLs Functional Dependencies Normalization ACID Properties SQL SubQueries SQL - Queries With Examples SQL Views Insert, Update, Delete Views SQL Join Views SQL Inline Views SQL - Nth Highest Salary SQL Second Highest Salary SQL - Difference Truncate / Delete SQL - Difference Truncate / Drop SQL - Difference HAVING / WHERE SQL - Difference CAST / CONVERT SQL - Difference NOT IN / NOT EXIST SQL - Difference IN / EXISTS SQL - Difference UNION / UNION ALL
co m/2007/04/sql-plsql-interview-questions. How does a syntax error differ from a runtime error? A syntax error can be detected by the PL/SQL compiler. p-code is ge nerated for the PL/SQL block.Delete Duplicate Records SQL .Difference Nested / Correlated Subquery SQL . and p-code generation . p-code is stored in the database. but it can have a return statement that simply stops its execution an d returns to the caller. For named blocks.REPLACE SQL .DATEADD() SQL .blogspot.TOP SQL . a storage address is assigned to the variables that are used to hold data for Oracle.GETDATE() SQL .DATEDIFF() SQL . binding.AVG() Ads by Google SQL Query Interview Questions SQL Server Tutorial Function PL SQL Oracle SQL & PL/SQL: SQL PL/SQL Interview Questions http://sql-plsql.ALTER TABLE SQL . A runtime error occurs wh ile the program is running and cannot be detected by the PL/SQL compiler. P-code is a list of instructions to the PL/SQL engine. and it is used the next time the progr am is executed. After synt ax errors have been corrected. What steps are included in the compilation process of a PL/SQL block? The compilation process includes syntax checking. Next.CREATE TABLE (More Examples) SQL .CREATE TABLE SQL . Syntax checking involves checking PL/SQL code for compilation errors.Difference views / Materialized views SQL Count SQL Update SQL Clustered / Non-Clustered Indexes SQL .Difference Unique/Primary Key SQL . .SUM() SQL .DATEPART() SQL . This process is called binding.SQL .LIKE SQL .html 1 of 5 10-10-11 6:42 AM SQL PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL any value.Convert() SQL .SELECT INTO SQL .
Foreign Key Constraint SQL . Explain Implicit and Explicit cursors Oracle automatically declares an implicit cursor every time a SQL statement is executed.ROLLUP SQL . Any locks acquired by the transaction are released. .Count_Big SQL . contains a syntax error.MIN() SQL . and the following results are true: . Rollback and Savepoint. All work done by the transaction becomes permanent. How an Implicit cursor works? SQL . With the SAVEPOINT command. All work done by the transaction is undone. The ROLLBACK statement undoes all the work done by the user in a specific transaction. A SELECT INTO statement returning no rows is an example of a runtime error. as if it hadn t been issued.Referential Integrity SQL .sp_columns SQL .MAX() SQL .Identity SQL .STUFF() SQL .Covered Query SQL . END. The user is unaware of this and cannot control or process the informat ion in an implicit cursor.A misspelled keyword is an example of a syntax error. however. the transaction has ended.Index Include SQL .Insert Multiple Values In Table SQL . this script: BEIN DBMS_OUTPUT. . The program defines an explicit cursor for any query that returns more than one row of data.Stored Procedure .Unique Constraint SQL . This error can be handled with the help of the exception-handling section of the PL/S QL block.Binary_Checksum SQL . When a ROLLBACK statement is issued to the database.Check Constraint SQL .Primary Key Constraint SQL . Any locks acquired by the transaction are released. This declaration allows the application to sequentially process each row of data as the cursor returns it. .PUT_LINE ('This is a test'). Define Commit.Diff Local/Global Temporary Tables SQL .Not Null Constraint SQL . the transaction has ended.Checksum_AGG SQL . For example.Default Constraint SQL .CUBE SQL .Insert Into Select SQL . Other users can see changes in data made by the transaction. an d the following results are true: . Try to find it. This means that the programmer has declared the cursor within the PL/SQ L code block. only part of the transaction c an be undone. When a COMMIT statement is issued to the database.
sp_who SQL .Dynamic SQL SQL .co m/2007/04/sql-plsql-interview-questions.blogspot.SQL Server Execution Plan SQL Interview Questions Oracle PL/SQL PL/SQL Introduction PL/SQL Procedures PL/SQL Functions PL/SQL Collections PL/SQL Records PL/SQL Table Based Records PL/SQL Programmer Defined Records PL/SQL Cursor Based Records PL/SQL Tables PL/SQL Varrays PL/SQL Nested Tables PL/SQL Loops PL/SQL Triggers PL/SQL Cursors PL/SQL Implicit Cursors PL/SQL Explicit Cursors PL/SQL REF Cursors PL/SQL Cursor For Loop PL/SQL Cursors with Parameters PL/SQL Where Current Of and For Update Examples of PL/SQL Cursors PL/SQL Exceptions PL/SQL Interview Questions SQL PL/SQL Sitemap Oracle SQL & PL/SQL: SQL PL/SQL Interview Questions http://sql-plsql. as long as an explicit cursor does not exist for that .html 2 of 5 10-10-11 6:42 AM PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL PL/SQL Any given PL/SQL block issues an implicit cursor whenever a SQL statement is executed.SQL .Session SQL .
Declaring the cursor. What is a mutating table error and how can you get around it? Oracle SQL & PL/SQL: SQL PL/SQL Interview Questions http://sql-plsql. Others What are PL/SQL Cursor Exceptions? Cursor_Already_Open. Value_Error. and fetched cursor must be closed t o release the memory allocation. INSERT). Invalid_Cursor What is the maximum number of triggers. 3.blogspot.co m/2007/04/sql-plsql-interview-questions. Opening the cursor. %FOUND cursor_name%FOUND A Boolean attribute that returns TRUE if the previous FETCH returned a row and FALSE if it did not. The declared cursor is opened. can apply to a single table? 12 triggers. This initializes the cursor into memory. 2. 4. The declared. %ROWCOUNT cursor_name%ROWCOUNT The number of records fetched from a cursor at that point in time. What are Explicit Cursor attributes %NOTFOUND cursor_name%NOTFOUND A Boolean attribute that returns TRUE if the previous FETCH did not return a row and FALSE if it did. and memory is allotted. 4. Answer any three PL/SQL Exceptions? Too_many_rows. DELETE. No_Data_Found. 3. 1. is called the SQL cursor. opened. An INSERT statement needs a place to receive the data that is to be inserted into the database. All UPDATE and DELETE statements have cursors that identify the set of rows that will be affected by the operation.SQL statement. A cursor is automatically associated with every DML (data manipulation) statement (UPDATE. Closing the cursor. The declared and opened cursor can now retrieve data. Zero_Error. the implicit cursor fulfills this need. 2. The most recently opened cursor 5. %ISOPEN cursor_name%ISOPEN A Boolean attribute that returns TRUE if the cursor is open and FALSE if it is not.html 3 of 5 10-10-11 6:42 AM Interview Questions SQL PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL . Fetching the cursor. How an Explicit cursor works? The process of working with an explicit cursor consists of the following steps: 1.
DBMS_OUTPUT. When is a declare statement needed? The DECLARE statement is used in PL/SQL anonymous blocks such as with stand alone. If they include the SQL routines provided by Oracle. It must come first in a PL/SQL stand alone file if it is used. What packages (if any) has Oracle provided for use by developers? Oracle provides the DBMS_ series of packages. DBMS_DDL. but not really what was asked. DBMS_TRANSACTION. What are SQLCODE and SQLERRM and why are they important for PL/SQL developers? . DBMS_UTILITY. If they can mention a few of these and describe how they used them. DBMS_PIPE. UTL_FILE. non-stored PL/SQL procedures. Describe the use of PL/SQL tables PL/SQL tables are scalar arrays that can be referenced by a binary integer. If not specified in this or der will result in the final return being done twice because of the way the %NOTFOUN D is handled by PL/SQL. or RECORD. In Oracle 8 the y will be able to be of the %ROWTYPE designation. DBMS_LOCK. DBMS_ALERT. even better. 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? OPEN then FETCH then LOOP followed by the exit when. The usual fix involves either use of views or temporary t ables so the database is selecting from one while updating the other. gre at. DBMS_JOB. It occurs because the trigger is trying to update a row it is currently using. There are many which developers should be aware of such as DBMS_SQL.PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL PL/SQL Interview Questions SQL PL/SQL Interview This happens with triggers. They can be used to hold values for use in later queries or calculations.
BEGIN l_2d_grid (1) (1) := 100. Th e SQLERRM returns the actual error message for the last error encountered. which were first supported in Oracle9i Database Release 1. Another possible method is to just use the SHOW ERROR command. the er ror that occurred in the code. you can emulate these structures using nested collection definitions. but this only shows errors.array_t. DECLARE l_2d_grid twodim_aa. They ca n be used in exception handling to report. How can you generate debugging output from PL/SQL? Use the DBMS_OUTPUT package. TYPE array_t IS TABLE OF data_t INDEX BY PLS_INTEGER. INSERT.array_t. First. which will serve as a two-dimensional array. or. (1. (1)(2). Here is a brief example to get you started and introduce you to some of the challenges you may encounter as you use collections in this way. How can you find within a PL/SQL block. CREATE OR REPLACE PACKAGE twodim_aa IS TYPE data_t IS TABLE OF NUMBER INDEX BY PLS_INTEGER. / The first. inner collection data_t contains the data for each cell in the two-dimensional array. How can I define a two-dimensional array of numbers in PL/SQL? Although PL/SQL does not natively support the declaration and manipulation of Oracle SQL & PL/SQL: SQL PL/SQL Interview Questions http://sql-plsql. ROW.206).SQLCODE returns the value of the error number for the last error encountered. TABLE. l_2d_grid (1) (2) := 120. UPDATE.1). . What are the types of triggers? There are 12 types of triggers in PL/SQL that consist of combinations of the BEFORE. AFTER. Also. since I am using associative arrays to define my two-dimensional array.co m/2007/04/sql-plsql-interview-questions. and (200)(206). In the following script. DELETE and ALL key words: BEFORE ALL ROW INSERT AFTER ALL ROW INSERT BEFORE INSERT AFTER INSERT etc. and then assign values to three cells: (1. if a cursor is open? Use the %ISOPEN cursor status variable. Notice that t he syntax is different from that used in traditional array cell specification.html 4 of 5 10-10-11 6:42 AM Quemsutilotindsimensional arrays. store in an error log table. END twodim_aa.blogspot. I declare such a coll ection DECLARE l_2d_grid twodim_aa. These are especially useful for the WHEN OTHERS exception. 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.2). Each row in the outer collection array_t contains a collection of the first type. create a collection of associative arrays. Now declare a variable based on that outer collection type array_t . name ly: (1)(1). I do not have to specify a size for this two-dimensional array. and (200.
l_2d_grid (200) (206) := 200.html Home Oracle SQL & PL/SQL: SQL PL/SQL Interview Questions http://sql-plsql.co m/2007/04/sql-plsql-interview-questions.com/technology/oramag/oracle/06-jan/ o16plsql.blogspot. IF l_2d_grid (1)(2) source of above question: http://www.oracle.html 5 of 5 10-10-11 6:42 AM .
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.