Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
21 Cards in this Set
- Front
- Back
Test Sync Iphone
|
I worked
|
|
Sintax PRAGMA Exeption_init ()
|
Declare
seuErro EXCEPTION; PRAGMA EXCEPTION_INIT (seuErro , -2292) -- ONDE -2292 É O NUMERO DO ERRO ORACLE |
|
Delta Between treated and non treated execeptions.
|
Treated exceptions are declared in the EXEPTION block of a PL SQL it permits the PL sql to continue processing even though and exeption occured. A non treated exception can be ppre defined and non predefined and cause oracle to stop the PL/Sql code.
|
|
Delta between Predefined and non predefined exeptions.
|
Predefined exceptions are default oracle exeptions and non predefined are exceptions created by the user.
|
|
Cite 5 examples of predefined exceptions:
|
ACCESS_INTO_NULL
CASE_NOT_FOUND COLLECTION_IS_NULL CURSOR_ALREADY_OPEN DUP_VAL_ON_INDEX INVALID_CURSOR INVALID_NUMBER LOGIN_DENIED NO_DATA_FOUND NOT_LOGGED_ON PROGRAM_ERROR ROWTYPE_MISMATCH SELF_IS_NULL STORAGE_ERROR SUBSCRIPT_BEYOND_COUNT SUBSCRIPT_OUTSIDE_LIMIT SYS_INVALID_ROWID TIMEOUT_ON_RESOURCE TOO_MANY_ROWS VALUE_ERROR ZERO_DIVIDE |
|
What is SQLCODE?
|
Returns the numeric value of and error code.
|
|
What is SQLERRM?
|
Returns the text ossociated of the error code.
|
|
What is the function of the RAISE command?
|
The raise command raises an exception under a user defined condition.
IF SQL%NOTFOUND THEN RAISE USER_DECLARED_EXEPTION. |
|
How do you declare an exception?
|
DECLARE
user_exception EXCEPTION; BEGIN ... |
|
Cite the syntax of the IF command.
|
IF <condition>
THEN <code> ELSE IF <condition> <code> END IF; END IF; |
|
Syntax of the CASE command.
|
CASE
WHEN <condition> THEN <result> WHEN <condition> THEN <result> ... <ELSE> <result> END; |
|
What are the three types of LOOP commands?
|
BASIC
FOR WHEN |
|
Syntax of a basic LOOP command.
|
LOOP
<code> EXIT WHEN <exit condition> END LOOP; |
|
Syntax of a WHILE loop.
|
WHILE <condition>
<code> END LOOP; |
|
Syntax of the FOR loop using IN.
|
FOR i in 1...<n> LOOP
<code> END LOOP; |
|
Show the sintax of a FOR...Loop using Select.
|
for rec in (select col_1, col_2 from table_a) loop
/*Statements, use rec.col_1 and rec.col_2 */ end loop; |
|
Quais os diferentes tipos de cursores?
|
Implicitos
Explicitos |
|
Declare a Basic Cursor sintax
|
CURSOR c1
IS SELECT course_number from courses_tbl; BEGIN open c1; fetch c1 into cnumber; if c1%notfound then cnumber := 9999; end if; close c1; |
|
Create loop with a cursor.
|
OPEN c1;
LOOP FETCH c1 INTO var; EXIT WHEN c1%NOTFOUND; |
|
Cite the 4 attributes of an explicit cursor.
|
%ISOPEN
%NOFOUND %FOUND %ROWCOUNT |
|
when you use the EXECUTE IMMEDIATE statment trying to a run a ddl and you get the folowing error:
ERRO na linha 1: ORA-01031: privilégios insuficientes ORA-06512: em "PLSQL10.MARCO", line 7 ORA-06512: em line 1 what do you need to do to your procedure? |
you need to add AUTHID CURRENT_USER to the declaration of the procedure EX:
create or replace procedure Marco ( nomeTab varchar2 , nomeCol1 varchar2 ) AUTHID CURRENT_USER is begin EXECUTE IMMEDIATE 'CREATE TABLE ' || nomeTab || '( ' || nomeCol1 || ' ) ' ; end; / |