This preview shows page 1. Sign up to view the full content.
Unformatted text preview: e
statement is executed.
In the fetch stage, rows are selected and ordered (if requested by the query), and each
successive fetch retrieves another row of the result, until the last row has been fetched.
You can fetch queries, but not the DML statements.
WWW.ExamMagic.COM - 17: What part of a database trigger determines the number of
times the trigger body executes?
A. Trigger type
www.ExamMagic.com 1Z0-147 B. Trigger body
C. Trigger event
D. Trigger timing
.COM - 18: Examine this code:
CREATE OR REPLACE FUNCTION gen_email_name
(p_first_name VARCHAR2, p_last_name VARCHAR2, p_id NUMBER)
v_email_home := SUBSTR(p_first_name, 1, 1) ||
SUBSTR(p_last_name, 1, 7) ||
SET email = v_email_name
WHERE employee_id = p_id;
You run this SELECT statement:
SELECT first_name, last_name
gen_email_name(first_name, last_name, 108) EMAIL
A. Employee 108 has his email name updated based on the return result of the function.
B. The statement fails because functions called from SQL expressions cannot perform
C. The statement fails because the functions does not contain code to end the transaction.
D. The SQL statement executes successfully, because UPDATE and DELETE statements
are ignoring in stored functions called from SQL expressions.
E. The SQL statement executes successfully and control is passed to the calling
• When called from a SELECT statement or a parallelized UPDATE or DELETE
statement, the function cannot modify any database tables
• When called from an UPDATE, or DELETE statement, the function cannot query or
modify any database tables modified by that statement.
• When called from a SELECT, INSERT, UPDATE, or DELETE statement, the
function cannot execute SQL transaction control statements (such as COMMIT), session
control statements (such as SET ROLE), or system control statements (such as ALTER
SYSTEM). Also, it cannot execute DDL statements (such as CREATE) because they are
followed by an automatic commit.
• The function cannot call another subprogram that breaks one of the above restrictions.
WWW.ExamMagic.COM - 19: Which table should you query to determine when your procedure was last compiled?
In the USER_OBJECTS there is
A. USER_PROCEDURES lists all functions and procedures, along with associated
properties. For example, ALL_PROCEDURES indicates whether or not a function is
pipelined, parallel enabled or an aggregate function. If a function is pipelined or an
aggregate function, the associated implementation type (if any) is also identified. It
doesn't have when the object was last complied.
B. There is nothing called USER_PROCS.
D. There is nothing called USER_PLSQL_UNITS
WWW.ExamMagic.COM - 20: Examine this code:
CREATE OR REPLACE TRIGGER secure_emp
BEFORE LOGON ON employees
IF (TO_CHAR(SYSDATE, 'DY') IN ('SAT', 'SUN')) OR
NOT BETWEEN '08:00' AND '18:00')
THEN RAISE_APPLICATION_ERROR (-20500, 'You may
insert into the EMPLOYEES table only during
What type of trigger is it?
A. DML trigger
B. INSTEAD OF trigger
C. Application trigger
D. System event trigger
E. This is an invalid trigger.
The Triggering Event is incorrect. A User does not LOGON or LOGOFF from a Table. You can't
create a BEFORE LOGON or AFTER LOGOFF trigger.
Event When allowed or applicable STARTUP AFTER SHUTDOWN BEFORE SERVERERROR AFTER LOGON AFTER LOGOFF BEFORE A. This trigger is not performing an INSERT, UPDATE or DELETE on Table
B. INSETED OF Triggers are defined on a VIEW
C. Application triggers fire when a particular event occurs in the application. Application
are developed using Oracle client-side tools, such as Oracle Forms Developer.
E. This is a failed attempt of creating a System Event Triiger. Modify the code to specify
AFTER LOGON ON DATABASE to correct the problem .
WWW.ExamMagic.COM - 21: Examine this package:
CREATE OR REPLACE PACKAGE discounts
g_id NUMBER := 7829;
discount_rate NUMBER := 0.00;
PROCEDURE display_price (p_price NUMBER);
CREATE OR REPLACE PACKAGE BODY discounts
PROCEDURE display_price (p_price NUMBER)
discount_rate := 0.10;
Which statement is true?
A. The value of DISCOUNT_RATE always remains 0.00 in a session.
B. The value of DISCOUNT_RATE is set to 0.10 each time the package is invoked in a
C. The value of DISCOUNT_RATE is set to 1.00 each time the procedure
DISPLAY_PRICE is invoked.
D. The value of DISCOUNT_RATE is set to 0.10 when the package is invoked for the
first time in a session.
A one-time-only procedure is executed only once, when the package is first invoked
View Full Document
This note was uploaded on 01/05/2011 for the course COMS 131 taught by Professor Dad during the Spring '10 term at University of Mumbai.
- Spring '10