OCA And Ocp Exam Quiz Questions

96 Questions | Total Attempts: 1063

SettingsSettingsSettings
OCA Exam Quizzes & Trivia

FOR THOSE WHO ARE GOING TO TAKE THE oca/ocp EXAM


Related Topics
Questions and Answers
  • 1. 
    • A. 

      SELECT CALC_PLAYER_AVG(PLAYER_ID) FROM PLAYER_BAT_STAT;

    • B. 

      EXECUTE CALC_PLAYER_AVG(31);

    • C. 

      CALC_PLAYER('RUTH');

    • D. 

      CALC_PLAYER_AVG(31);

    • E. 

      START CALC_PLAYER_AVG(31)

  • 2. 
    Examine this code: CREATE OR REPLACE PRODECURE add_dept (p_dept_name VARCHAR2 DEFAULT 'placeholder', p_location VARCHAR2 DEFAULT 'Boston')IS BEGIN INSERT INTO departments VALUES (dept_id_seq.NEXTVAL, p_dept_name, p_location); END add_dept; / Which three are valid calls to the add_dep procedure? (Choose three)
    • A. 

      Add_dept;

    • B. 

      Add_dept('Accounting');

    • C. 

      Add_dept(, 'New York');

    • D. 

      Add_dept(p_location=>'New York');

  • 3. 
    • A. 

      Packages can be nested.

    • B. 

      You can pass parameters to packages.

    • C. 

      A package is loaded into memory each time it is invoked

    • D. 

      The contents of packages can be shared by many applications.

    • E. 

      You can achieve information hiding by making package constructs private

  • 4. 
    Which two programming constructs can be grouped within a package? (Choose two)
    • A. 

      Cursor

    • B. 

      Constant

    • C. 

      Trigger

    • D. 

      Sequence

    • E. 

      View

  • 5. 
    • A. 

      It persists across transactions within a session.

    • B. 

      It persists from session to session for the same user.

    • C. 

      It does not persist across transaction within a session

    • D. 

      It persists from user to user when the package is invoked

    • E. 

      It does not persist from session to session for the same user.

  • 6. 
    • A. 

      ALTER TABLE emp ADD CONSTRAINT ck_sal CHECK (sal BETWEEN sal AND sal*1.1);

    • B. 

      CREATE OR REPLACE TRIGGER check_sal BEFORE UPDATE OF sal ON emp FOR EACH ROW WHEN (new.sal < old.sal OR new.sal > old.sal * 1.1) BEGIN RAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease salary not increase by more than 10%'); END;

    • C. 

      CREATE OR REPLACE TRIGGER check_sal BEFORE UPDATE OF sal ON emp WHEN (new.sal < old.sal OR new.sal > old.sal * 1.1) BEGIN RAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease salary not increase by more than 10%'); END;

    • D. 

      CREATE OR REPLACE TRIGGER check_sal AFTER UPDATE OR sal ON emp WHEN (new.sal < old.sal OR -new.sal > old.sal * 1.1) BEGIN RAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease salary not increase by more than 10%'); END;

  • 7. 
    Which statement is valid when removing procedures?
    • A. 

      Use a drop procedure statement to drop a standalone procedure.

    • B. 

      Use a drop procedure statement to drop a procedure that is part of a package. Then recompile the package specification.

    • C. 

      Use a drop procedure statement to drop a procedure that is part of a package. Then recompile the package body

    • D. 

      For faster removal and re-creation, do not use a drop procedure statement. Instead, recompile the procedure using the alter procedure statement with the REUSE SETTINGS clause.

  • 8. 
    Examine this package: CREATE OR REPLACE PACKAGE BB_PACK IS V_MAX_TEAM_SALARY NUMBER(12,2); PROCEDURE ADD_PLAYER(V_ID IN NUMBER, V_LAST_NAME VARCHAR2, V_SALARY NUMBER); END BB_PACK; / CREATE OR REPLACE PACKAGE BODY BB_PACK IS PROCEDURE UPD_PLAYER_STAT (V_ID IN NUMBER, V_AB IN NUMBER DEFAULT 4, V_HITS IN NUMBER) IS BEGIN UPDATE PLAYER_BAT_STAT SET AT_BATS = AT_BATS + V_AB, HITS = HITS + V_HITSWHERE PLAYER_ID = V_ID; COMMIT; END UPD_PLAYER_STAT; PROCEDURE ADD_PLAYER (V_ID IN NUMBER, V_LAST_NAME VARCHAR2, V_SALARY NUMBER) IS BEGIN INSERT INTO PLAYER(ID,LAST_NAME,SALARY) VALUES (V_ID, V_LAST_NAME, V_SALARY); UPD_PLAYER_STAT(V_ID,0,0); END ADD_PLAYER; END BB_PACK; You make a change to the body of the BB_PACK package. The BB_PACK body is recompiled. What happens if the stand alone procedure VALIDATE_PLAYER_STAT references this package?
    • A. 

      VALIDATE_PLAYER_STAT cannot recompile and must be recreated

    • B. 

      VALIDATE_PLAYER_STAT is not invalidated

    • C. 

      VALDIATE_PLAYER_STAT is invalidated

    • D. 

      VALIDATE_PLAYER_STAT and BB_PACK are invalidated

  • 9. 
    You need to create a trigger on the EMP table that monitors every row that is changed and places this information into the AUDIT_TABLE. What type of trigger do you create?
    • A. 

      FOR EACH ROW trigger on the EMP table.

    • B. 

      Statement-level trigger on the EMP table.

    • C. 

      FOR EACH ROW trigger on the AUDIT_TABLE table.

    • D. 

      Statement-level trigger on the AUDIT_TABLE table

    • E. 

      FOR EACH ROW statement-level trigger on the EMP table.

  • 10. 
    Which statements are true? (Choose all that apply)
    • A. 

      If errors occur during the compilation of a trigger, the trigger is still created.

    • B. 

      If errors occur during the compilation of a trigger you can go into SQL *Plus and query the USER_TRIGGERS data dictionary view to see the compilation errors

    • C. 

      If errors occur during the compilation of a trigger you can use the SHOW ERRORS command within iSQL *Plus to see the compilation errors

    • D. 

      If errors occur during the compilation of a trigger you can go into SQL *Plus and query the USER_ERRORS data dictionary view to see compilation errors.

  • 11. 
    Which two dictionary views track dependencies? (Choose two)
    • A. 

      USER_SOURCE

    • B. 

      UTL_DEPTREE

    • C. 

      USER_OBJECTS /DBA_DEPENDENT_OBJECTS

    • D. 

      DEPTREE_TEMPTAB

    • E. 

      USER_DEPENDENCIES

  • 12. 
    Given a function CALCTAX: CREATE OR REPLACE FUNCTION calctax (sal NUMBER) RETURN NUMBER IS BEGIN 1z0-147 RETURN (sal * 0.05); END; If you want to run the above function from the SQL *Plus prompt, which statement is true?
    • A. 

      You need to execute the command CALCTAX(1000);.

    • B. 

      You need to execute the command EXECUTE FUNCTION calctax;.

    • C. 

      You need to create a SQL *Plus environment variable X and issue the command :X := CALCTAX(1000);.

    • D. 

      You need to create a SQL *Plus environment variable X and issue the command EXECUTE :X := CALCTAX;

    • E. 

      You need to create a SQL *Plus environment variable X and issue the command EXECUTE :X := CALCTAX(1000);

  • 13. 
    • A. 

      The rows are selected and ordered

    • B. 

      The validity of the SQL statement is established

    • C. 

      An area of memory is established to process the SQL statement.

    • D. 

      The SQL statement is run and the number of rows processed is returned.

    • E. 

      The area of memory established to process the SQL statement is released

  • 14. 
    What part of a database trigger determines the number of times the trigger body executes?
    • A. 

      Trigger type

    • B. 

      Trigger body

    • C. 

      Trigger event

    • D. 

      Trigger timing

  • 15. 
    Examine this code: CREATE OR REPLACE FUNCTION gen_email_name(p_first_name VARCHAR2, p_last_name VARCHAR2, p_id NUMBER) RETURN VARCHAR2is v_email_name VARCHAR2(19); BEGIN v_email_home := SUBSTR(p_first_name, 1, 1) || SUBSTR(p_last_name, 1, 7) || '@Oracle.com'; UPDATE employees SET email = v_email_nameWHERE employee_id = p_id; RETURN v_email_name; END; You run this SELECT statement: SELECT first_name, last_namegen_email_name(first_name, last_name, 108) EMAIL FROM employees; What occurs?
    • 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 DML.

    • 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 environment

  • 16. 
    Which table should you query to determine when your procedure was last compiled?
    • A. 

      USER_PROCEDURES

    • B. 

      USER_PROCS

    • C. 

      USER_OBJECTS

    • D. 

      USER_PLSQL_UNITS

  • 17. 
    Examine this code: CREATE OR REPLACE TRIGGER secure_emp BEFORE LOGON ON employees BEGIN IF (TO_CHAR(SYSDATE, 'DY') IN ('SAT', 'SUN')) OR (TO_CHAR(SYSDATE, 'HH24:MI') NOT BETWEEN '08:00' AND '18:00') THEN RAISE_APPLICATION_ERROR (-20500, 'You may insert into the EMPLOYEES table only during business hours.'); END IF; END; / 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

  • 18. 
    Examine this package: CREATE OR REPLACE PACKAGE discounts IS g_id NUMBER := 7829; discount_rate NUMBER := 0.00; PROCEDURE display_price (p_price NUMBER); END discounts; / CREATE OR REPLACE PACKAGE BODY discounts IS PROCEDURE display_price (p_price NUMBER) IS BEGIN DBMS_OUTPUT.PUT_LINE('Discounted '|| TO_CHAR(p_price*NVL(discount_rate, 1))); END display_price; BEGIN discount_rate := 0.10; END discounts; / 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 session.

    • C. 

      The value of DISCOUNT_RATE is set to 1.00 each time the procedure DISPLAY_PRICE is invoked. 1z0-147

    • D. 

      The value of DISCOUNT_RATE is set to 0.10 when the package is invoked for the first time in a session.

  • 19. 
    Examine this code: CREATE OR REPLACE TRIGGER update_emp AFTER UPDATE ON emp BEGIN INSERT INTO audit_table (who, dated) VALUES (USER, SYSDATE); END; You issue an UPDATE command in the EMP table that results in changing 10 rows. How many rows are inserted into the AUDIT_TABLE?
    • A. 

      1

    • B. 

      10

    • C. 

      None

    • D. 

      A value equal to the number of rows in the EMP table

  • 20. 
    There is a CUSTOMER table in a schema that has a public synonym CUSTOMER and you are granted all object privileges on it. You have a procedure PROCESS_CUSTOMER that processes customer information that is in the public synonym CUSTOMER table. You have just created a new table called CUSTOMER within your schema. Which statement is true?
    • A. 

      Creating the table has no effect and procedure PROCESS_CUSTOMER still accesses data from public synonym CUSTOMER table.

    • B. 

      If the structure of your CUSTOMER table is the same as the public synonym CUSTOMER table then the procedure PROCESS_CUSTOMER is invalidated and gives compilation errors. 1z0-147

    • C. 

      If the structure of your CUSTOMER table is entirely different from the public synonym CUSTOMER table then the procedure PROCESS_CUSTOMER successfully recompiles and accesses your CUSTOMER table.

    • D. 

      . If the structure of your CUSTOMER table is the same as the public synonym CUSTOMER table then the procedure PROCESS_CUSTOMER successfully recompiles when invoked and accesses your CUSTOMER table.

  • 21. 
    Which two statements about packages are true? (Choose two)
    • A. 

      Both the specification and body are required components of a package.

    • B. 

      The package specification is optional, but the package body is required

    • C. 

      The package specification is required, but the package body is optional.

    • D. 

      The specification and body of the package are stored together in the database

    • E. 

      The specification and body of the package are stored separately in the database.

  • 22. 
    When creating a function in SQL *Plus, you receive this message: "Warning: Function created with compilation errors." Which command can you issue to see the actual error message?
    • A. 

      SHOW FUNCTION_ERROR

    • B. 

      SHOW USER_ERRORS

    • C. 

      SHOW ERRORS

    • D. 

      . SHOW ALL_ERRORS

  • 23. 
    Which four triggering events can cause a trigger to fire? (Choose four)
    • A. 

      A specific error or any errors occurs

    • B. 

      A database is shut down or started up.

    • C. 

      A specific user or any user logs on or off.

    • D. 

      A user executes a CREATE or an ALTER table statement

    • E. 

      A user executes a SELECT statement with an ORDER BY clause. /A user executes a JOIN statement that uses four or more tables.

  • 24. 
    Examine this procedure: CREATE OR REPLACE PROCEDURE ADD_PLAYER (V_ID IN NUMBER, V_LAST_NAME VARCHAR2) IS BEGIN INSERT INTO PLAYER (ID,LAST_NAME) VALUES (V_ID, V_LAST_NAME); COMMIT; END; This procedure must invoke the APD_BAT_STAT procedure and pass a parameter. Which statement, when added to the above procedure will successfully invoke the UPD_BAT_STAT procedure?
    • A. 

      EXECUTE UPD_BAT_STAT(V_ID);

    • B. 

      UPD_BAT_STAT(V_ID

    • C. 

      RUN UPD_BAT_STAT(V_ID);

    • D. 

      START UPD_BAT_STAT(V_ID);

  • 25. 
    Which statement about triggers is true?
    • A. 

      You use an application trigger to fire when a DELETE statement occurs

    • B. 

      You use a database trigger to fire when an INSERT statement occurs

    • C. 

      You use a system event trigger to fire when an UPDATE statement occurs.

    • D. 

      You use INSTEAD OF trigger to fire when a SELECT statement occurs

  • 26. 
    You want to create a PL/SQL block of code that calculates discounts on customer orders. -This code will be invoked from several places, but only within the program unit ORDERTOTAL. What is the most appropriate location to store the code that calculates the discounts?
    • A. 

      A stored procedure on the server

    • B. 

      A block of code in a PL/SQL library.

    • C. 

      A standalone procedure on the client machine

    • D. 

      A block of code in the body of the program unit ORDERTOTAL

    • E. 

      A local subprogram defined within the program unit ORDERTOTAL

  • 27. 
    Which type of argument passes a value from a procedure to the calling environment?
    • A. 

      VARCHAR2

    • B. 

      BOOLEAN

    • C. 

      OUT

    • D. 

      IN

  • 28. 
    You are about to change the arguments of the CALC_TEAM_AVG function. Which dictionary view can you query to determine the names of the procedures and functions that invoke the CALC_TEAM_AVG function?
    • A. 

      USER_PROC_DEPENDS

    • B. 

      USER_DEPENDENCIES

    • C. 

      USER_REFERENCES

    • D. 

      USER_SOURCE

  • 29. 
    A CALL statement inside the trigger body enables you to call ______.
    • A. 

      A package.

    • B. 

      A stored function.

    • C. 

      A stored procedure

    • D. 

      Another database trigger

  • 30. 
    You need to remove the database trigger BUSINESS_HOUR. Which command do you use to remove the trigger in the SQL *Plus environment?
    • A. 

      DROP TRIGGER business_hour;

    • B. 

      DELETE TRIGGER business_hour;

    • C. 

      REMOVE TRIGGER business_hour;

    • D. 

      ALTER TRIGGER business_hour REMOVE;

    • E. 

      DELETE FROM USER_TRIGGERS WHERE TRIGGER_NAME = 'BUSINESS_HOUR';

  • 31. 
    Examine this procedure: CREATE OR REPLACE PROCEDURE INSERT_TEAM(V_ID in NUMBER, V_CITY in VARCHAR2 DEFAULT 'AUSTIN', V_NAME in VARCHAR2) IS BEGIN INSERT INTO TEAM (id, city, name) VALUES (v_id, v_city, v_name); COMMIT; END Which two statements will successfully invoke this procedure in SQL *Plus? (Choose two)
    • A. 

      EXECUTE INSERT_TEAM;

    • B. 

      EXECUTE INSERT_TEAM(3, V_NAME=>'LONGHORNS', V_CITY=>'AUSTIN');

    • C. 

      EXECUTE INSERT_TEAM(3, 'AUSTIN','LONGHORNS');

    • D. 

      EXECUTE INSERT_TEAM (V_ID := V_NAME := 'LONGHORNS', V_CITY := 'AUSTIN');

    • E. 

      EXECUTE INSERT_TEAM (3, 'LONGHORNS');

  • 32. 
    To be callable from a SQL expression, a user-defined function must do what?
    • A. 

      Be stored only in the database.

    • B. 

      Have both IN and OUT parameters.

    • C. 

      Use the positional notation for parameters

    • D. 

      Return a BOOLEAN or VARCHAR2 data type.

  • 33. 
    • A. 

      A stored procedure is typically written in SQL

    • B. 

      A stored procedure is a named PL/SQL block that can accept parameters.

    • C. 

      A stored procedure is a type of PL/SQL subprogram that performs an action.

    • D. 

      A stored procedure has three parts: the specification, the body, and the exception handler part

    • E. 

      The executable section of a stored procedure contains statements that assigns values, control execution, and return values to the calling environment

  • 34. 
    Examine this code: CREATE OR REPLACE PROCEDURE add_dept ( p_name departments.department_name%TYPE DEFAULT 'unknown', p_loc departments.location_id%TYPE DEFAULT 1700) IS BEGIN INSERT INTO departments(department_id, department_name, loclation_id)VALUES(dept_seq.NEXTVAL,p_name, p_loc); END add_dept; / You created the add_dept procedure above, and you now invoke the procedure in SQL *Plus. Which four are valid invocations? (Choose four)
    • A. 

      EXECUTE add_dept(p_loc=>2500)

    • B. 

      EXECUTE add_dept('Education', 2500)

    • C. 

      EXECUTE add_dept('2500', p_loc =>2500)

    • D. 

      EXECUTE add_dept(p_name=>'Education', 2500)

    • E. 

      EXECUTE add_dept(p_loc=>2500, p_name=>'Education')

  • 35. 
    Which three are valid ways to minimize dependency failure? (Choose three)
    • A. 

      Querying with the SELECT * notification.

    • B. 

      Declaring variables with the %TYPE attribute

    • C. 

      Specifying schema names when referencing objects

    • D. 

      Declaring records by using the %ROWTYPE attribute.

    • E. 

      Specifying package.procedure notation while executing procedures

  • 36. 
    Which two dopes the INSTEAD OF clause in a trigger identify? (Choose two)
    • A. 

      The view associated with the trigger

    • B. 

      The table associated with the trigger.

    • C. 

      The event associated with the trigger.

    • D. 

      The package associated with the trigger

    • E. 

      The statement level or for each row association to the trigger.

  • 37. 
    Examine this package: CREATE OR REPLACE PACKAGE manage_emps IS tax_rate CONSTANT NUMBER(5,2) := .28; v_id NUMBER; PROCEDURE insert_emp (p_deptno NUMBER, p_sal NUMBER); PROCEDURE delete_emp; PROCEDURE update_emp; FUNCTION calc_tax (p_sal NUMBER) RETURN NUMBER; END manage_emps; / CREATE OR REPLACE PACKAGE BODY manage_emps IS PROCEDURE update_sal (p_raise_amt NUMBER) IS BEGIN UPDATE emp SET sal = (sal * p_raise_emt) + sal WHERE empno = v_id; END; PROCEDURE insert_emp (p_deptno NUMBER, p_sal NUMBER) IS BEGIN INSERT INTO emp(empno, deptno, sal) VALYES(v_id, p_depntno, p_sal); END insert_emp; PROCEDURE delete_emp IS BEGIN DELETE FROM emp WHERE empno = v_id; END delete_emp; PROCEDURE update_emp IS v_sal NUMBER(10, 2); v_raise NUMBER(10, 2); BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = v_id; IF v_sal < 500 THEN v_raise := .05; ELSIP v_sal < 1000 THEN v_raise := .07; ELSE v_raise := .04; END IF; update_sal(v_raise); END update_emp; 1z0-147 FUNCTION calc_tax (p_sal NUMBER) RETURN NUMBER IS BEGIN RETURN p_sal * tax_rate; END calc_tax; END manage_emps; / What is the name of the private procedure in this package?
    • A. 

      CALC_TAX

    • B. 

      INSERT_EMP

    • C. 

      UPDATE_SAL

    • D. 

      DELETE_EMP

    • E. 

      UPDATE_EMP /MANAGE_EMPS

  • 38. 
    • A. 

      Use the DBMS_LOB.WRITE procedure to write data to a BFILE

    • B. 

      Use the DBMS_LOB.BFILENAME function to locate an external BFILE.

    • C. 

      Use the DBMS_LOB.FILEEXISTS function to find the location of a BFILE.

    • D. 

      Use the DBMS_LOB.FILECLOSE procedure to close the file being accessed.

  • 39. 
    Examine this package: CREATE OR REPLACE PACKAGE BB_PACK APPEND Append the contents of the source LOB to the destination LOB COPY Copy all or part of the source LOB to the destination LOB ERASE Erase all or part of a LOB LOADFROMFILE Load BFILE data into an internal LOB TRIM Trim the LOB value to a specified shorter length WRITE Write data to the LOB from a specified offset GETLENGTH Get the length of the LOB value INSTR Return the matching position of the nth occurrence of the pattern in the LOB READ Read data from the LOB starting at the specified offset SUBSTR Return part of the LOB value starting at the specified offset FILECLOSE Close the file FILECLOSEALL Close all previously opened files FILEEXISTS Check if the file exists on the server FILEGETNAME Get the directory alias and file name FILEISOPEN Check if the file was opened using the input BFILE locators FILEOPEN Open a file 1z0-147 IS V_MAX_TEAM_SALARY NUMBER(12,2); PROCEDURE ADD_PLAYER(V_ID IN NUMBER, V_LAST_NAME VARCHAR2, V_SALARY NUMBER); END BB_PACK; / CREATE OR REPLACE PACKAGE BODY BB_PACK IS V_PLAYER_AVG NUMBER(4,3); PROCEDURE UPD_PLAYER_STAT V_ID IN NUMBER, V_AB IN NUMBER DEFAULT 4, V_HITS IN NUMBER) IS BEGIN UPDATE PLAYER_BAT_STAT SET AT_BATS = AT_BATS + V_AB, HITS = HITS + V_HITS WHERE PLAYER_ID = V_ID; COMMIT; VALIDATE_PLAYER_STAT(V_ID); END UPD_PLAYER_STAT; PROCEDURE ADD_PLAYER (V_ID IN NUMBER, V_LAST_NAME VARCHAR2, V_SALARY NUMBER) IS BEGIN INSERT INTO PLAYER(ID,LAST_NAME,SALARY) VALUES (V_ID, V_LAST_NAME, V_SALARY); UPD_PLAYER_STAT(V_ID,0,0); END ADD_PLAYER; END BB_PACK / Which statement will successfully assign .333 to the V_PLAYER_AVG variable from a procedure outside the package?
    • A. 

      V_PLAYER_AVG := .333;

    • B. 

      BB_PACK.UPD_PLAYER_STAT.V_PLAYER_AVG := .333;

    • C. 

      BB_PACK.V_PLAYER_AVG := .333;

    • D. 

      This variable cannot be assigned a value from outside of the package.

  • 40. 
    Examine this code: CREATE OR REPLACE PACKAGE comm_package 1z0-147 IS g_comm NUMBER := 10; PROCEDURE reset_comm(p_comm IN NUMBER); END comm_package; / User Jones executes the following code at 9:01am: EXECUTE comm_package.g_comm := 15 User Smith executes the following code at 9:05am: EXECUTE comm_paclage.g_comm := 20 Which statement is true?
    • A. 

      G_comm has a value of 15 at 9:06am for Smith.

    • B. 

      G_comm has a value of 15 at 9:06am for Jones

    • C. 

      G_comm has a value of 20 at 9:06am for both Jones and Smith.

    • D. 

      G_comm has a value of 15 at 9:03 am for both Jones and Smith

    • E. 

      G_comm has a value of 10 at 9:06am for both Jones and Smith. /g_comm has a value of 10 at 9:03am for both Jones and Smith

  • 41. 
    Examine this code: CREATE OR REPLACE FUNCTION gen_email_name (p_first_name VARCHAR2, p_last_name VARCHAR2, p_id NUMBER) RETURN VARCHAR2 IS v_email_name VARCHAR2(19); 6 BEGIN v_email_name := SUBSTR(p_first_name, 1, 1) || SUBSTR(p_last_name, 1, 7) || [email protected] .; UPDATE employees SET email = v_email_name WHERE employee_id = p_id; RETURN v_email_name; END; Which statement removes the function?
    • A. 

      DROP gen_email_name;

    • B. 

      REMOVE gen_email_name;

    • C. 

      DELETE gen_email_name;

    • D. 

      DROP FUNCTION gen_email_name;

  • 42. 
    Examine this procedure: CREATE OR REPLACE PROCEDURE UPD_BAT_STAT (V_ID IN NUMBER DEFAULT 10, V_AB IN NUMBER DEFAULT 4) IS BEGIN UPDATE PLAYER_BAT_STAT SET AT_BATS = AT_BATS + V_AB WHERE PLAYER_ID = V_ID; COMMIT; END; Which two statements will successfully invoke this procedure in SQL *Plus? (Choose two)
    • A. 

      EXECUTE UPD_BAT_STAT;

    • B. 

      EXECUTE UPD_BAT_STAT(V_AB=>10, V_ID=>31);

    • C. 

      EXECUTE UPD_BAT_STAT(31, 'FOUR','TWO');

    • D. 

      UPD_BAT_STAT(V_AB=>10, V_ID=>31);

    • E. 

      RUN UPD_BAT_STAT

  • 43. 
    Examine this code: CREATE OR REPLACE PROCEDURE audit_action   (p_who VARCHAR2) AS BEGIN INSERT INTO audit(schema_user) VALUES(p_who); END audit_action; / CREATE OR REPLACE TRIGGER watch_it AFTER LOGON ON DATABASE CALL audit_action(ora_login_user) 1z0-147 / What does this trigger do?
    • A. 

      The trigger records an audit trail when a user makes changes to the database.

    • B. 

      The trigger marks the user as logged on to the database before an audit statement is issued.

    • C. 

      The trigger invoked the procedure audit_action each time a user logs on to his/her schema and adds the username to the audit table.

    • D. 

      The trigger invokes the procedure audit_action each time a user logs on to the database and adds the username to the audit table.

  • 44. 
    Which view displays indirect dependencies, indenting each dependency?
    • A. 

      DEPTREE

    • B. 

      IDEPTREE

    • C. 

      INDENT_TREE

    • D. 

      I_DEPT_TREE

  • 45. 
    Examine the trigger: CREATE OR REPLACE TRIGGER Emp_count AFTER DELETE ON Emp_tab FOR EACH ROW DELCARE n INTEGER; BEGIN SELECT COUNT(*) INTO n FROM Emp_tab; DBMS_OUTPUT.PUT_LINE(' There are now ' || a || ' employees,'); END; This trigger results in an error after this SQL statement is entered: DELETE FROM Emp_tab WHERE Empno = 7499; How do you correct the error?
    • A. 

      Change the trigger type to a BEFORE DELETE

    • B. 

      Take out the COUNT function because it is not allowed in a trigger

    • C. 

      Remove the DBMS_OUTPUT statement because it is not allowed in a trigger.

    • D. 

      Change the trigger to a statement-level trigger by removing FOR EACH ROW

  • 46. 
    Which two program declarations are correct for a stored program unit? (Choose two)
    • A. 

      CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER

    • B. 

      CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER) RETURN NUMBER

    • C. 

      . CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER)

    • D. 

      CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER(10,2)

    • E. 

      CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER(10, 2))

  • 47. 
    You have a row level BEFORE UPDATE trigger on the EMP table. This trigger contains a SELECT statement on the EMP table to ensure that the new salary value falls within the minimum and maximum salary for a given job title. What happens when you try to update a salary value in the EMP table?
    • A. 

      The trigger fires successfully.

    • B. 

      The trigger fails because it needs to be a row level AFTER UPDATE trigger.

    • C. 

      The trigger fails because a SELECT statement on the table being updated is not allowed.

    • D. 

      The trigger fails because you cannot use the minimum and maximum functions in a BEFORE UPDATE trigger.

  • 48. 
    Examine this code: CREATE OR REPLACE STORED FUNCTION get_sal (p_raise_amt NUMBER, p_employee_id employees.employee_id%TYPE) RETURN NUMBER 1z0-147 IS v_salary NUMBER; v_raise NUMBER(8,2); BEGIN SELECT salary INTO v_salary FROM employees WHERE employee_id = p_employee_id; v_raise := p_raise_amt * v_salary;RETURN v_raise; END; Which statement is true?
    • A. 

      This statement creates a stored procedure named get_sal.

    • B. 

      This statement returns a raise amount based on an employee id.

    • C. 

      This statement creates a stored function named get_sal with a status of invalid

    • D. 

      This statement creates a stored function named get_sal.

    • E. 

      This statement fails.

  • 49. 
    You need to disable all triggers on the EMPLOYEES table. Which command accomplishes this?
    • A. 

      None of these commands; you cannot disable multiple triggers on a table in one command.

    • B. 

      ALTER TRIGGERS ON TABLE employees DISABLE;

    • C. 

      ALTER employees DISABLE ALL TRIGGERS;

    • D. 

      ALTER TABLE employees DISABLE ALL TRIGGERS;

  • 50. 
    An internal LOB is _____.
    • A. 

      A table.

    • B. 

      A column that is a primary key.

    • C. 

      Stored in the database.

    • D. 

      A file stored outside of the database, with an internal pointer to it from a database column.

  • 51. 
    Examine this code: CREATE OR REPLACE FUNCTION calc_sal(p_salary NUMBER) RETURN NUMBER IS v_raise NUMBER(4,2) DEFAULT 1.08; BEGIN RETURN v_raise * p_salary; END calc_sal; / Which statement accurately call the stored function CALC_SAL? (Choose two)
    • A. 

      UPDATE employees (calc_sal(salary)) SET salary = salary * calc_sal(salary);

    • B. 

      INSERT calc_sal(salary) INTO employees WHERE department_id = 60;

    • C. 

      DELETE FROM employees(calc_sal(salary)) WHERE calc_sal(salary) > 1000;

    • D. 

      SELECT salary, calc_sal(salary) FROM employees WHERE department_id = 60;

    • E. 

      SELECT last_name, salary, calc_sal(salary) FROM employees ORDER BY calc_sal(salary);

  • 52. 
    This statement fails when executed: CREATE OR REPLACE TRIGGER CALC_TEAM_AVG AFTER INSERT ON PLAYER BEGIN INSERT INTO PLAYER_BATSTAT (PLAYER_ID, SEASON_YEAR,AT_BATS,HITS) VALUES (:NEW.ID, 1997, 0,0); END; To which type must you convert the trigger to correct the error?
    • A. 

      Row

    • B. 

      Statement

    • C. 

      ORACLE FORM trigger

    • D. 

      Before

  • 53. 
    Examine this code: CREATE OR REPLACE PROCEDURE audit_emp (p_id IN emp_empno%TYPE) IS v_id NUMBER; PROCEDURE log_exec IS BEGIN INSERT INTO log_table (user_id, log_delete) VALUES (USER, SYSDATE); END log_exec; v_name VARCHAR2(20); BEGIN DELETE FROM emp WHERE empno = p_id; log_exec; SELECT ename, empnoINTO v_name, v_id FROM empWHERE empno = p_id; END audit_emp; Why does this code cause an error when compiled?
    • A. 

      An statement is not allowed in a subprogram declaration

    • B. 

      Procedure LOG_EXEC should be declared before any identifiers.

    • C. 

      Variable v_name should be declared before declaring the LOG_EXEC procedure

    • D. 

      The LOG_EXEC procedure should be invoked as EXECUTE log_exec with the AUDIT_EMP procedure.

  • 54. 
     Examine this code: CREATE OR REPLACE PACKAGE metric_converter IS c_height CONSTRAINT NUMBER := 2.54; c_weight CONSTRAINT NUMBER := .454; FUNCTION calc_height (p_height_in_inches NUMBER) RETURN NUMBER; FUNCTION calc_weight (p_weight_in_pounds NUMBER) RETURN NUMBER; END; / CREATE OR REPLACE PACKAGE BODY metric_converter IS FUNCTION calc_height (p_height_in_inches NUMBER) RETURN NUMBER IS BEGIN RETURN p_height_in_inches * c_height; END calc_height; FUNCTION calc_weight (p_weight_in_pounds NUMBER) RETURN NUMBER IS BEGIN RETURN p_weight_in_pounds * c_weight END calc_weight END metric_converter; / CREATE OR REPLACE FUNCTION calc_height (p_height_in_inches NUMBER) RETURN NUMBER IS BEGIN RETURN p_height_in_inches * metric_converter.c_height; END calc_height; / Which statement is true?
    • A. 

      If you remove the package specification, then the package body and the stand alone stored function CALC_HEIGHT are removed.

    • B. 

      If you remove the package body, then the package specification and the stand alone stored function CALC_HEIGHT are removed

    • C. 

      If you remove the package specification, then the package body is removed.

    • D. 

      If you remove the package body, then the package specification is removed.

    • E. 

      If you remove the stand alone stored function CALC_HEIGHT, then the METRIC_CONVERTER package body and the package specification are removed. /The stand alone function CALC_HEIGHT cannot be created because its name is used in a packaged function.

  • 55. 
    What is a condition predicate in a DML trigger?
    • A. 

      A conditional predicate allows you to specify a WHEN-LOGGING-ON condition in the trigger body.

    • B. 

      A conditional predicate means you use the NEW and OLD qualifiers in the trigger body as a condition

    • C. 

      A conditional predicate allows you to combine several DBM triggering events into one in the trigger body.

    • D. 

      A conditional predicate allows you to specify a SHUTDOWN or STARTUP condition in the trigger body.

  • 56. 
    Examine this package specification:CREATE OR REPLACE PACKAGE concat_all IS v_string VARCHAR2(100); PROCEDURE combine (p_num_val NUMBER); PROCEDURE combine (p_date_val DATE); PROCEDURE combine (p_char_val VARCHAR2, p_num_val NUMBER); END concat_all; / Which overloaded COMBINE procedure declaration can be added to this package specification?
    • A. 

      PROCEDURE combine;

    • B. 

      PROCEDURE combine (p_no NUMBER);

    • C. 

      PROCEDURE combine (p_val_1 VARCHAR2, p_val_2 NUMBER;

    • D. 

      PROCEDURE concat_all (p_num_val VARCHAR2, p_char_val NUMBER);

  • 57. 
    • A. 

      There is no affect on procedure A and it runs successfully.

    • B. 

      Procedure B is invalidated and recompiles when invoked

    • C. 

      Procedure A is invalidated and recompiles for the first time it is invoked

    • D. 

      Procedure A is invalidated and recompiles for the second time it is invoked

  • 58. 
    Under which two circumstances do you design database triggers? (Choose two)
    • A. 

      To duplicate the functionality of other triggers

    • B. 

      To replicate built-in constraints in the Oracle server such as primary key and foreign key.

    • C. 

      To guarantee that when a specific operation is performed, related actions are performed.

    • D. 

      For centralized, global operations that should be fired for the triggering statement, regardless of which user or application issues the statement.

  • 59. 
    Examine this procedure: CREATE OR REPLACE PROCEDURE DELETE_PLAYER (V_ID IN NUMBER) IS BEGIN DELETE FROM PLAYER WHERE ID = V_ID; EXCEPTION WHEN STATS_EXITS_EXCEPTION THEN DBMS_OUTPUT.PUT_LINE ('Cannot delete this player, child records exist in PLAYER_BAT_STAT table'); END; What prevents this procedure from being created successfully?
    • A. 

      A comma has been left after the STATS_EXIST_EXCEPTION exception.

    • B. 

      The STATS_EXIST_EXCEPTION has not been declared as a number.

    • C. 

      The STATS_EXIST_EXCEPTION has not been declared as an exception.

    • D. 

      Only predefined exceptions are allowed in the EXCEPTION section.

  • 60. 
    Examine this package: CREATE OR REPLACE PACKAGE manage_emps IS tax_rate CONSTANT NUMBER (5,2) :- .28; v_id NUMBER; PROCEDURE insert_emp (p_deptno NUMBER, P_sal NUMBER) ; PROCEDURE delete_emp; PROCEDURE update_emp; FUNCTION calc_tax (p_sal NUMBER) RETURN NUMBER; END manage_emps; / CREATE OR REPLACE PACKAGE BODY manage_emps IS PROCEDURE update_sal (p_raise_amt NUMBER) IS BEGIN UPDATE emp SET sal = (sal * p_raise_emt) + sal WHERE empno = v_id; END; PROCEDURE insert_emp (p_deptno NUMBER, p_sal NUMBER) IS BEGIN INSERT INTO emp(empno, deptno, sal) VALYES (v_id, p_depntno, p_sal); END insert emp; PROCEDURE delete_emp IS BEGIN DELETE FROM emp WHERE empno = v id; END delete_emp; PROCEDURE update_empIS v_sal NUMBER (10, 2); v_raise NUMBER (10, 2); BEGIN SELECT sal INTO v_sal FROM empWHERE empno = v_id; IF v_sal < 500 THEN v_raise : = .05; ELSIP v_sal < 1000 THEN v_raise : = .07; ELSE v_raise : = .04; FUNCTION calc_tax END IF; update_sal (v_raise) ; END update_emp ; (p_sal NUMBER) RETURN NUMBER IS BEGIN RETURN p_sal * tax_rate; END cale_tax; END manage_emps; / How many public procedures are in the MANAGE_EMPS package?
    • A. 

      1

    • B. 

      2

    • C. 

      3

    • D. 

      4

    • E. 

      5

  • 61. 
    Which command must you issue to allow users to access the UPD_TEAM_STAT trigger on the TEAM table?
    • A. 

      GRANT SELECT, INSERT, UPDATE, DELETE ON TEAM TO PUBLIC

    • B. 

      GRANT SELECT, INSERT, UPDATE, DELETE ON UPD_TEAM_STAT TO PUBLIC

    • C. 

      GRANT EXECUTE ON TEAM TO PUBLIC

    • D. 

      GRANT SELECT, EXECUTE ON TEAM, UPD_TEAM_STAT TO PUBLIC

  • 62. 
    Examine this code: CREATE OR REPLACE PROCEDURE set_bonus (p_cutoff IN VARCHAR2 DEFAULT 'WEEKLY'p_employee_id IN employees_employee_id%TYPE p_salary IN employees_salary%TYPE, p_bonus_percent IN OUT NUMBER DEFAULT 1.5, p_margin OUT NUMBER DEFAULT 2, p_bonus_value OUT NUMBER) IS BEGIN UPDATE emp_bonus SET bonus_amount =(p_salary * p_bonus_percent)/p_margin WHERE employee_id = p_employee_id; END set_bonus; / You execute the CREATE PROCEDURE statement above and notice that it fails. What are two reasons why it fails? (Choose two)
    • A. 

      The syntax of the UPDATE statement is incorrect.

    • B. 

      You cannot update a table using a stored procedure.

    • C. 

      The format parameter p_bonus_value is declared but is not used anywhere. /The formal parameter p_cutoff cannot have a DEFAULT clause.

    • D. 

      The declaration of the format parameter p_margin cannot have a DEFAULT clause

    • E. 

      The declaration of the format parameter p_bonus_percent cannot have a DEFAULT clause

  • 63. 
    Which three statements are true regarding database triggers? (Choose three)
    • A. 

      A database trigger is a PL/SQL block, C, or Java procedure associated with a table, view, schema, or the database

    • B. 

      A database trigger needs to be executed explicitly whenever a particular event takes place.

    • C. 

      A database trigger executes implicitly whenever a particular event takes place

    • D. 

      A database trigger fires whenever a data event (such as DML) or system event (such as logon, shutdown) occurs on a schema or database.

    • E. 

      With a schema, triggers fire for each event for all users; with a database, triggers fire for each event for that specific user

  • 64. 
    You create a DML trigger. For the timing information, which are valid with a DML trigger? (Choose all that apply)
    • A. 

      DURING

    • B. 

      IN PLACE OF

    • C. 

      ON SHUTDOWN

    • D. 

      BEFORE

    • E. 

      ON STATEMENT EXECUTION

  • 65. 
    All users currently have the INSERT privilege on the PLAYER table. You only want your users to insert into this table using the ADD_PLAYTER procedure. Which two actions must you take? (Choose two)
    • A. 

      GRANT SELECT ON ADD_PLAYER TO PUBLIC

    • B. 

      GRANT EXECTUE ON ADD_PLAYER TO PUBLIC

    • C. 

      GRANT INSERT ON PLAYER TO PUBLIC

    • D. 

      GRANT EXECTUE INSERT ON ADD_PLAYER TO PUBLIC

    • E. 

      REVOKE INSERT ON PLAYER FROM PUBLIC;

  • 66. 
    When creating a function, in which section will you typically find the RETURN keyword?
    • A. 

      HEADER only

    • B. 

      DECLARATIVE

    • C. 

      EXECUTABLE and HEADER

    • D. 

      DECLARATIVE,EXECUTABLE and EXCEPTION HANDLING

  • 67. 
    A dependent procedure or function directly or indirectly references one or more of which four objects? (Choose four)
    • A. 

      View

    • B. 

      Sequence

    • C. 

      Privilege

    • D. 

      Procedure

    • E. 

      Packaged procedure or function

  • 68. 
    Which three are true regarding error propagation? (Choose three)
    • A. 

      An exception cannot propagate across remote procedure calls.

    • B. 

      An exception raised inside a declaration immediately propagates to the current block

    • C. 

      The use of the RAISE; statement in an exception handler reprises the current exception

    • D. 

      An exception raised inside an exception handler immediately propagates to the enclosing block

  • 69. 
    Which two tables or views track object dependencies? (Choose two)
    • A. 

      USER_DEPENDENCIES

    • B. 

      USER_IDEPTREE

    • C. 

      IDEPTREE

    • D. 

      USER_DEPTREE

    • E. 

      USER_DEPENDS

  • 70. 
    Examine the trigger heading: CREATE OR REPLACE TRIGGER salary_check BEFORE UPDATE OF sal, job ON emp FOR EACH ROW Under which condition does this trigger fire?
    • A. 

      When a row is inserted into the EMP table.

    • B. 

      When the value of the SAL or JOB column in a row is updated in the EMP table.

    • C. 

      When any column other than the SAL and JOB columns in a row are updated in the EMP table.

    • D. 

      Only when both values of the SAL and JOB columns in a row are updated together in the EMP table.

  • 71. 
    You have an AFTER UPDATE row-level on the table EMP. The trigger queries the EMP table and inserts the updating user's information into the AUDIT_TABLE. What happens when the user updates rows on the EMP table?
    • A. 

      A compile time error occurs.

    • B. 

      A runtime error occurs. The effect of trigger body and the triggering statement are rolled back.

    • C. 

      A runtime error occurs. The effect of trigger body is rolled back, but the update on the EMP table takes place

    • D. 

      The trigger fires successfully. The update on the EMP table occurs, and data is inserted into theAUDIT_TABLE table.

    • E. 

      A runtime error occurs. The update on the EMP table does not take place, but the insert into the AUDIT_TABLE occurs.

  • 72. 
    You disabled all triggers on the EMPLOYEES table to perform a data load. Now, you need to enable all triggers on the EMPLOYEES table. Which command accomplished this?
    • A. 

      You cannot enable multiple triggers on a table in one command

    • B. 

      . ALTER TRIGGERS ON TABLE employees ENABLE;

    • C. 

      ALTER employees ENABLE ALL TRIGGERS;

    • D. 

      ALTER TABLE employees ENABLE ALL TRIGGERS;

  • 73. 
    When creating stored procedures and functions, which construct allows you to transfer values to and from the calling environment?
    • A. 

      Local variables

    • B. 

      Arguments

    • C. 

      Boolean variables

    • D. 

      Substitution variables

  • 74. 
    You have the following table: CREATE TABLE Emp_log ( Emp_id NUMBER Log_date DATE, New_salary NUMBER, Action VARCHAR (20)); You have the following data in the EMPLOYEES table: EMPLOYEE_ID LAST_NAME SALARY DEPARTMENT_ID ----------- ------------------- ------------ ------------- 100 King 24000 90 101 Kochhar 17000 90 102 De Haan 17000 90 103 Hunold 9000 60 104 Ernst 6000 60 105 Austin 4800 60 106 Pataballa 4800 60 107 Lorentz 4200 60 108 Greenberg 12000 100 201 Hartstein 13000 20 202 Fay 6000 20 You create this trigger: CREATE OR REPLACE TRIGGER Log_salary_increase 36 AFTER UPDATE ON employees FOR EACH ROW WHEN (new.Salary > 1000) BEGIN INSERT INTO Emp_log (Emp_id, Log_date, New_Salary, Action) VALUES (: new.Employee_id, SYSDATE, :new.salary, 'NEW SAL' ); END / Then, you enter the following SQL statement: UPDATE Employee SET Salary = Salary + 1000.0 Where Department_id = 20M What are the result in the EMP_LOG table?
    • A. 

      EMP_ID LOG_DATE NEW_SALARY ACTION ---------- -------- ---------- ---------- 201 24-SEP-02 13000 NEW SAL 202 24-SEP-02 600 NEW SAL

    • B. 

      EMP_ID LOG_DATE NEW_SALARY ACTION ---------- -------- ---------- ---------- 201 24-SEP-02 14000 NEW SAL 202 24-SEP-02 7000 NEW SAL

    • C. 

      C. EMP_ID LOG_DATE NEW_SALARY ACTION ---------- -------- ---------- ---------- 201 24-SEP-02 NEW SAL 202 24-SEP-02 NEW SAL

    • D. 

      No rows are inserted.

  • 75. 
    Which code successfully calculates tax?
    • A. 

      CREATE OR REPLACE PROCEDURE calctax (p_no IN NUMBER) RETURN tax IS v_sal NUMBER; tax Number; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = p_no; tax := v_sal * 0.05; END;

    • B. 

      CREATE OR REPLACE FUNCTION calctax (p_no NUMBER) RETURN NUMBER IS v_sal NUMBER tax NUMBER BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = p_no; tax := v_sal * 0.05;

    • C. 

      CREATE OR REPLACE FUNCTION calctax (p_no NUMBER) RETURN NUMBER IS v_sal NUMBER; tax NUMBER; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = p_no; tax := v_sal * 0.05; END

    • D. 

      . CREATE OR REPLACE FUNCTION calctax (p_no NUMBER) IS v_sal NUMBER; tax NUMBER; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = p_no; tax := v_sal * 0.05; END;

  • 76. 
    Examine this code: CREATE OR REPLACE FUNCTION gen_email_name(p_first VARCHAR2, p_last VARCHAR2) RETURN VARCHAR2IS v_email_name VARCHAR (19) ; BEGIN v_email_bame := SUBSTR(p_first, 1, 1) || SUBSRE(p_last, 1, 7) || RETURN v_email_name; END / Which two statements are true?
    • A. 

      This function is invalid.

    • B. 

      This function can be used against any table.

    • C. 

      This function cannot be used in a SELECT statement.

    • D. 

      This function can be used only if the two parameters passed in are not bull values.

    • E. 

      This function will generate a string based on 2 character values passed into the function.

  • 77. 
    Examine the code examples. Which one is correct?
    • A. 

      CREATE OR REPLACE TRIGGER authorize_action BEFORE INSERT ON EMPLOYEES CALL log_exectution; /

    • B. 

      CREATE OR REPLACE TRIGGER authorize_action BEFORE EMPLOYEES INSERT CALL log_exectution;

    • C. 

      CREATE OR REPLACE TRIGGER authorize_action BEFORE EMPLOYEES INSERT CALL log_exectution;

    • D. 

      CREATE OR REPLACE TRIGGER authorize_action CALL log_exectution; BEFORE INSERT ON EMPLOYEES; /

  • 78. 
    You need to create a DML trigger. Which five pieces need to be identified? (Choose five)
    • A. 

      Table

    • B. 

      DML event /Trigger name /Trigger timing

    • C. 

      Trigger body

    • D. 

      Package body

    • E. 

      Package name

  • 79. 
    Procedure PROCESS_EMP references the table EMP. Procedure UPDATE_EMP updates rows if table EMP through procedure PROCESS_EMP. There is a remote procedure QUERY_EMP that queries the EMP table through the local procedure PROCESS_EMP. The dependency mode is set to TIMESTAMP in this session. Which two statements are true? (Choose two)
    • A. 

      If the signature of procedure PROCESS_EMP is modified and successfully recompiles, the EMP table is invalidated.

    • B. 

      If internal logic of procedure PROCESS_EMP is modified and successfully recompiles, UPDATE_EMP gets invalidated and will recompile when invoked for the first time.

    • C. 

      If the signature of procedure PROCESS_EMP is modified and successfully recompiles, UPDATE_EMP gets invalidated and will recompile when invoked for the first time.

    • D. 

      If internal logic of procedure PROCESS_EMP is modified and successfully recompiles, QUERY_EMP gets invalidated and will recompile when invoked for the first time.

    • E. 

      If internal logic of procedure PROCESS_EMP is modified and successfully recompiles, QUERY_EMP gets invalidated and will recompile when invoked for the second time.

  • 80. 
    Examine this package: CREATE OR REPLACE PACKAGE pack_cur IS CURSOR c1 IS SELECT prodid FROM poduct ORDER BY prodid DESC; PROCEDURE proc1; PROCEDURE proc2; END pack_cur; / CREATE OR REPLACE PACKAGE BODY pack_cur IS v_prodid NUMBER; PROCEDURE proc1 IS BEGIN OPEN C1 LOOP FETCH C1 INTO v_prodid; DBMS_OUTPUT.PUT_LINE ( 'Row is: '| | c1%ROWCOUNT); EXIT WHEN c1%ROWCONT >= 3; END LOOP;  END procl; PROCEDURE proc2 IS BEGIN LOOP FETCH C1 INTO v_prodid; DBMS_OUTPUT.PUT_LINE ( 'Row is: '| | c1%ROWCOUNT); EXIT WHEN c1%ROWCONT >= 6; END LOOP;  CLOSE C1; END proc2; END pack_cur; / The product table has more than 1000 rows. The SQL *Plus SERVEROUTPUT setting is turned on in your session. You execute the procedure PROC1 from SQL *Plus with the command: EXECUTE pack_cur.proc1 What is the output in your session?
    • A. 

      ERROR at line 1:

    • B. 

      Row is: Row is: Row is:

    • C. 

      Row is: 1 Row is: 2 Row is: 3

    • D. 

      . Row is: 4 Row is: 5 Row is: 6

  • 81. 
    When using a packaged function in a query, what is true?
    • A. 

      The COMMIT and ROLLBACK commands are allowed in the packaged function.

    • B. 

      You can not use packaged functions in a query statement

    • C. 

      The packaged function cannot execute an INSERT, UPDATE, or DELETE statement against the table that is being queried.

    • D. 

      The packaged function can execute and INSERT, UPDATE, or DELETE statement against the table that is being queried if it is used in a subquery

    • E. 

      The packaged function can execute an INSERT, UPDATEM or DELETE statement against the table that is being queried if the pragma RESTRICT REFERENCE is used.

  • 82. 
    You have a table with the following definition:CREATE TABLE long_tab ( id NUMBER,long_col LONG) You need to convert the LONG_COL column from a LONG data type to a LOB data type. Which statement accomplish this task?
    • A. 

      ALTER TABLE long_tab MODIFY (LONG_COL CLOB);

    • B. 

      EXECUTE dbms_lob.migrate(long_tab, long_col, clob)

    • C. 

      EXECUTE dbms_manage.lob.migrate(long_tab, long_col, clob)

    • D. 

      EXECUTE utl_lob.migrate(long_tab, long_col, clob)

    • E. 

      EXECUTE utl_manage_lob.migrate(long_tab, long_col, clob)

  • 83. 
    Why do we use INSTEAD OF trigger?
    • A. 

      To perform clean up action when ending a user session

    • B. 

      To insert data into view that doesn't accept insert normally

    • C. 

      To insert into an audit table when data is updated in sensitive column

    • D. 

      To modify data in which DML statement has been issued against an inherently non-updatable view

  • 84. 
    CREATE OR REPLACE PACKAGE discounts IS G_ID NUMBER:=7839; DISCOUNT_RATE NUMBER 0. 00; PROCEDURE DISPLAY_PRICE (V_PRICE NUMBER); END DISCOUNTS; / CREATE OR REPLACE PACKAGE BODY discounts IS PROCEDURE DISPLAY_PRICE (V_PRICE_NUMBER) 12 IS BEGIN DBMS_OUTPUT.PUT_LINE(‘DISCOUNTED||2_4 (V_PRICE*NVL(DISCOUNT_RATE, 1))) END DISPLAY_PRICE; BEGIN DISCOUNT_RATE;=0. 10; END DISCOUNTS; / Which statement is true?
    • A. 

      The value of DISCOUNT_RATE always remain 0. 00 in a session.

    • B. 

      The value of DISCOUNT_RATE is set to 0. 10 each time the package are invoked in a session.

    • C. 

      The value of DISCOUNT_RATE is set to 1 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 first time in a session.

  • 85. 
    If there is any changes applied to the package specification or body of a stored sub-program which statement is true about it?
    • A. 

      Package Specification only requires recompilation

    • B. 

      Package body only requires recompilation

    • C. 

      Both package & body requires recompilation

    • D. 

      Both package & body does not require recompilation.

  • 86. 
    You work as an application developer for federal Inc. the company uses an oracle database. The database contains a package named G_Comm. You want to remove the package specification from the database while retaining the package body. Which of the following statements will you use to accomplish this?
    • A. 

      DROP Package G_Comm;

    • B. 

      DROP Package Specification G_Comm;

    • C. 

      DROP Package Body G_Comm;

    • D. 

      You cannot accomplish this;

  • 87. 
    You work as an application developer for federal Inc. the company uses an Oracle database. You have created a function named My_Func in the database. You want to change the arguments declared for the function. Before changing the arguments you want to see the names of the procedures and other functions that invoke the My_Func function. Which of the following data dictionary views will you query to accomplish this? (choose two)
    • A. 

      USER_DB_LINKS

    • B. 

      ALL_DEPENDENCIES

    • C. 

      USER_DEPENDENCIES

    • D. 

      USER_SOURCE

  • 88. 
    You work as an application developer for Dolliver Inc. The company uses an oracle database. You own subprograms that reference to other subprograms on remote locations. Oracle server uses the signature mode of remote dependency in order to manage remote dependencies among the subprograms. Which of the following statements about the signature mode of dependency are true? (Choose two)
    • A. 

      Oracle Server records only the signature for each PL/SQL program unit.

    • B. 

      Using the signature mode prevents the unnecessary recompilation of dependent local procedures, as it allows remote procedures to be recompiled without affecting the dependent local procedures.

    • C. 

      Signature mode is the default mode of remote dependency.

    • D. 

      Oracle server records both the timestamp and the signature for each PL/SQL program unit.

  • 89. 
    Debug the logic in a stored procedure. How do you monitor the value of variables in the procedure using SQL Plus environment?
    • A. 

      INSERT TEXT_IO.PUT_LINE statement to view data on the screen when the stored procedure is executed.

    • B. 

      Insert break points in the code and observe the variable values displayed to the screen as the procedure is executed.

    • C. 

      Insert DBMS_OUTPUT.PUT_LINE statement to view data on the screen when the stored procedure is executed

    • D. 

      Insert DEBUG VARIABLE statements to view the variable values on the screen as the procedure is executed.

  • 90. 
    Which script file must be executed before you can determine indirect independence’s using the DEPTREE AND IDEPTREE VIEWS?
    • A. 

      UTL_IDEPT.SQL.

    • B. 

      UTLIDD.SQL

    • C. 

      UTLINDD.SQL.

    • D. 

      UTLDTREE.SQL

  • 91. 
    Examine this package body: CREATE OR REPLACE PACKAGE BODY forward_pack IS V_sum NUMBER; - 44 - PROCEDURE calc_ord(. . . ); PROCEDURE generate_summary(. . . ) IS BEGIN Calc_ord(. . . ); . . . END calc_ord; END forward_pack; / Which construct has a forward declaration?
    • A. 

      V_SUM

    • B. 

      CALC_ORD

    • C. 

      FORWARD_PACK

    • D. 

      GENERATE_SUMMARY.

  • 92. 
    Which one is the correct routine for the utilization order when using dynamic SQL?
    • A. 

      Open, Parse, Bind, Execute, Fetch, Close

    • B. 

      Parse, Bind, open, Execute, Close, Fetch

    • C. 

      Bind, Open, Parse, Execute, Fetch, Close

    • D. 

      Open, Bind, Parse, Execute, Close, Fetch

  • 93. 
    Given the header of a procedure ACCOUNT_TRANSACTION:CREATE OR REPLACE PROCEDURE ACCOUNT_TRANSACTION IS BEGIN END; Which command will execute the PROCEDURE ACCOUNT_TRANSACTION from the SQL Plus prompt?
    • A. 

      ACCOUNT_TRANSACTION;

    • B. 

      RUN ACCOUNT_TRANSACTION

    • C. 

      START ACCOUNT_TRANSACTION

    • D. 

      EXECUTE ACCOUNT_TRANSACTION

  • 94. 
    Which compiler directive to check the purity level of functions?
    • A. 

      PRAGMA SECURITY_LEVEL.

    • B. 

      PRAGMA SEARIALLY_REUSABLE.

    • C. 

      PRAGMA RESTRICT_REFERRENCES.

    • D. 

      PRAGMA RESTRICT_PURITY_LEVEL

    • E. 

      PRAGMA RESTRICT_FUNCTION_REFERRENCE.

  • 95. 
    You want to send a message to another session connected to the same instance. Which Oracle supplied package will you use to achieve this task?
    • A. 

      DBMS_JOB

    • B. 

      DBMS_PIPES

    • C. 

      DBMS_OUTPUT

    • D. 

      DBMS_MESSAGE

    • E. 

      SEND_MESSAGE

  • 96. 
    Which Oracle supply package allows you to run jobs at use defined times?
    • A. 

      DBMS_JOB

    • B. 

      DBMS_RUN

    • C. 

      DBMS_PIPE

    • D. 

      DBMS_SQL