Beruflich Dokumente
Kultur Dokumente
a log table
whenever an Oracle Server error occurs. True or False?
EXCEPTION
WHEN OTHERS THEN
INSERT INTO err_log_table (num_col, char_col)
VALUES (SQLCODE, SQLERRM);
END;
(Assume that err_log_table has been created with suitable columns and datatypes.)
FALSE
When an exception is trapped in the WHEN OTHERS exception handler, you can use
a set of generic functions to identify those errors. You cannot use SQLCODE or
SQLERRM directly in a SQL statement. Instead you must assign their values to local
variables and then use the variables in the SQL statement.
DECLARE
err_num NUMBER;
err_msg VARCHAR(100);
EXCEPTION
WHEN OTHERS THEN
err_num := SQLCODE;
err_msg := SQLCODE;
INSERT INTO err_log_table (num_col, char_col)
VALUES (err_num, err_msg);
END;
DECLARE
e_sal_except EXCEPTION;
PRAGMA EXCEPTION_INIT(e_sal_except,-02290);
Others
Select statement returns more than one row
A check constraint is violated
A SQL UPDATE statement does not update any rows
A row is FETCHED from a cursor while the cursor is closed
The number range -20000 to -20999 is reserved by Oracle for programmer use, and is
never used for predefined Oracle Server errors.
You can use the %ROWTYPE with tables and views.
True
Exceptions declared in a block are considered local to that block and global to all its
sub blocks
True
Subprograms
Named pl/sql blocks
Compiled only once
Stored in the database
Named and therefore can be invoked by
other applications
Subprograms called functions must
return values
Can take parameters
END;
Procedure SOMEPROC has five parameters named A, B, C, D, E in that order. The procedure was called as follows:
SOMEPROC(10,20,D=>50);
How was parameter B referenced?
Positional
Named
A combination of positionally and named
A combination of named and defaulted
Defaulted
IN
OUT
INOUT
You have created a function named NEWFUNC. You now change some of the
function code, and try to recreate the function by executing : CREATE OR
REPLACE FUNCTION newfunct. What happens?
The function is automatically dropped and then recreated
You want to remove the procedure NO_NEED from your schema. You
execute: DROP PROCEDURE no_need
Which Data Dictionary views are updated automatically
USER_PROCEDURES
USER_OBJECTS
USER_SOURCE
All of the above
You want to see the names, modes and data types of the formal parameters
of function MY_FUNC in your schema. How can you do this
Query USER_PARAMETERS
Query USER_SOURCE
Query USER_FUNCTIONS
SHOW PARAMETER my_func
DESCRIBE my_func
User BOB creates procedure MYPROC using the default Definer's Rights. BOB then executes:
GRANT EXECUTE ON bob.myproc TO ted;
When TED invokes BOB.MYPROC, whose privileges are checked?
TED's privileges
PUBLIC's privileges
SYSTEM's privileges
BOB's privileges
ORACLE's privileges