This action might not be possible to undo. Are you sure you want to continue?
c om / 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 specifically to see if a variable's value is NULL 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 specified in that type. A procedure does not have a return type in its specification and should not return any value, but it can have a return statement that simply stops its execution and returns to the caller. What steps are included in the compilation process of a PL/SQL block? The compilation process includes syntax checking, binding, and p-code generation. Syntax checking involves checking PL/SQL code for compilation errors. After syntax errors have been corrected, a storage address is assigned to the variables that are used to hold data for Oracle. This process is called binding. Next, p-code is generated for the PL/SQL block. P-code is a list of instructions to the PL/SQL engine. For named blocks, p-code is stored in the database, and it is used the next time the program is executed. How does a syntax error differ from a runtime error? A syntax error can be detected by the PL/SQL compiler. A runtime error occurs while the program is running and cannot be detected by the PL/SQL compiler. A misspelled keyword is an example of a syntax error. For example, this script: BEIN DBMS_OUTPUT.PUT_LINE ('This is a test'); END;
The ROLLBACK statement undoes all the work done by the user in a specific transaction. For more on SQL & PL/SQLht t p: // sql . Any locks acquired by the transaction are released. as if it hadn’t been issued. A cursor is automatically associated with every DML (data manipulation) statement (UPDATE. Explain Implicit and Explicit cursors Oracle automatically declares an implicit cursor every time a SQL statement is executed. however. and the following results are true: . bl ogspot . A SELECT INTO statement returning no rows is an example of a runtime error. . 4. The most recently opened cursor is called the SQL cursor. . and the following results are true: . The user is unaware of this and cannot control or process the information in an implicit cursor. only part of the transaction can be undone. An INSERT statement needs a place to receive the data that is to be inserted into the database. How an Implicit cursor works? 1. When a ROLLBACK statement is issued to the database. c om / Define Commit. Any given PL/SQL block issues an implicit cursor whenever a SQL statement is executed. Rollback and Savepoint. How an Explicit cursor works? . This declaration allows the application to sequentially process each row of data as the cursor returns it. Try to find it. All work done by the transaction is undone. This error can be handled with the help of the exception-handling section of the PL/SQL block. . With the SAVEPOINT command.pl sql .contains a syntax error. INSERT). 2. the transaction has ended. 5. All work done by the transaction becomes permanent. as long as an explicit cursor does not exist for that SQL statement. Any locks acquired by the transaction are released. The program defines an explicit cursor for any query that returns more than one row of data. c om / For more on SQL & PL/SQLht t p: // sql . Other users can see changes in data made by the transaction. DELETE. 3. This means that the programmer has declared the cursor within the PL/SQL code block. All UPDATE and DELETE statements have cursors that identify the set of rows that will be affected by the operation. When a COMMIT statement is issued to the database. the transaction has ended. bl ogspot . the implicit cursor fulfills this need.pl sql .
The declared. It occurs because the trigger is trying to update a row it is currently using. %ISOPEN cursor_name%ISOPEN A Boolean attribute that returns TRUE if the cursor is open and FALSE if it is not. This initializes the cursor into memory. Declaring the cursor. and fetched cursor must be closed to release the memory allocation. Invalid_Cursor What is the maximum number of triggers.pl sql . Fetching the cursor. Closing the cursor. . DBMS_TRANSACTION. %ROWCOUNT cursor_name%ROWCOUNTThe 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. There are many which developers should be aware of such as DBMS_SQL. bl ogspot . For more on SQL & PL/SQLht t p: // sql . The declared cursor is opened. Answer any three PL/SQL Exceptions? Too_many_rows. c om / 3. DBMS_PIPE. DBMS_LOCK. 4. The declared and opened cursor can now retrieve data.pl sql .The process of working with an explicit cursor consists of the following steps: 1. %FOUND cursor_name%FOUND A Boolean attribute that returns TRUE if the previous FETCH returned a row and FALSE if it did not. Value_Error. What packages (if any) has Oracle provided for use by developers? Oracle provides the DBMS_ series of packages. bl ogspot . What is a mutating table error and how can you get around it? This happens with triggers. can apply to a single table? 12 triggers. The usual fix involves either use of views or temporary tables so the database is selecting from one while updating the other. and memory is allotted. Others What are PL/SQL Cursor Exceptions? Cursor_Already_Open. 2. No_Data_Found. Opening the cursor. opened. c om / For more on SQL & PL/SQLht t p: // sql . Zero_Error.
They can be used to . If they can mention a few of these and describe how they used them. DBMS_JOB. UTL_FILE. DBMS_DDL. great. DBMS_OUTPUT. but not really what was asked. Describe the use of PL/SQL tables PL/SQL tables are scalar arrays that can be referenced by a binary integer. If they include the SQL routines provided by Oracle. even better.DBMS_ALERT. DBMS_UTILITY.