OCA And OCP Exam Quiz!

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Sourav005
S
Sourav005
Community Contributor
Quizzes Created: 1 | Total Attempts: 1,658
| Attempts: 1,658
SettingsSettings
Please wait...
  • 1/96 Questions

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

    • DROP TRIGGER business_hour;
    • DELETE TRIGGER business_hour;
    • REMOVE TRIGGER business_hour;
    • ALTER TRIGGER business_hour REMOVE;
    • DELETE FROM USER_TRIGGERS WHERE TRIGGER_NAME = 'BUSINESS_HOUR';
Please wait...
About This Quiz

Are you familiar with OCA and OCP? Would you like to try this quiz? OCA stands for Oracle Certified Associate, while OCP stands for Oracle Certification Program. OCA is a beginner’s exam, while OCP is the next step toward certification, and this exam is more in-depth when it comes to knowledge of technology. If you want to learn more about OCA and OCP, this is the quiz for you.

OCA And OCP Exam Quiz! - Quiz

Quiz Preview

  • 2. 

    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?

    • SHOW FUNCTION_ERROR

    • SHOW USER_ERRORS

    • SHOW ERRORS

    • . SHOW ALL_ERRORS

    Correct Answer
    A. SHOW ERRORS
    Explanation
    The correct answer is SHOW ERRORS. When creating a function in SQL *Plus, if there are any compilation errors, the message "Warning: Function created with compilation errors" is displayed. To see the actual error message, the command SHOW ERRORS can be issued. This command will provide detailed information about the errors that occurred during the creation of the function.

    Rate this question:

  • 3. 

    Which type of argument passes a value from a procedure to the calling environment?

    • VARCHAR2

    • BOOLEAN

    • OUT

    • IN

    Correct Answer
    A. OUT
    Explanation
    The type of argument that passes a value from a procedure to the calling environment is the OUT argument. When a procedure has an OUT argument, it means that the procedure will modify the value of the argument and pass it back to the calling environment. This allows the procedure to return a value or multiple values to the caller.

    Rate this question:

  • 4. 

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

    • DURING

    • IN PLACE OF

    • ON SHUTDOWN

    • BEFORE

    • ON STATEMENT EXECUTION

    Correct Answer
    A. BEFORE
    Explanation
    BEFORE is a valid timing option for a DML trigger. It specifies that the trigger should be executed before the DML operation is performed. This allows the trigger to modify the data before it is inserted, updated, or deleted. DURING, IN PLACE OF, ON SHUTDOWN, and ON STATEMENT EXECUTION are not valid timing options for a DML trigger.

    Rate this question:

  • 5. 

    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?

    • You cannot enable multiple triggers on a table in one command

    • . ALTER TRIGGERS ON TABLE employees ENABLE;

    • ALTER employees ENABLE ALL TRIGGERS;

    • ALTER TABLE employees ENABLE ALL TRIGGERS;

    Correct Answer
    A. ALTER TABLE employees ENABLE ALL TRIGGERS;
    Explanation
    The correct answer is "ALTER TABLE employees ENABLE ALL TRIGGERS;". This command enables all triggers on the EMPLOYEES table.

    Rate this question:

  • 6. 

    Which code can you use to ensure that the salary is not increased by more than 10% at a time nor is it ever decreased?

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

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

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

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

    Correct Answer
    A. 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;
    Explanation
    Row triggers are the correct chose for solving the problem. A row trigger fires each time the table is affected by the triggering event. If the triggering event affects no rows, a row trigger is not executed. Row triggers are useful if the trigger action depends on data of rows that are affected or on data provided by the triggering event itself. You can create a BEFORE row trigger in order to prevent the triggering operation from succeeding if a certain condition is violated. Within a ROW trigger, reference the value of a column before and after the data change by prefixing it with the OLD and NEW qualifier. Incorrect Answers:
    A: Check constaint can't do this job lets take a look:
    SQL> ALTER TABLE emp ADD
    2 CONSTRAINT ck_sal CHECK (sal BETWEEN sal AND sal*1.1)

    3 /
    Table altered.
    SQL> select ename, sal
    2 from emp
    3 where ename = 'KING';
    ENAME SAL

    KING 5000 Now let's issue an update statement SQL> update emp 2 set sal = 10 3 where ename = 'KING'; 1 row updated. As you can see the check constraint can't compare the old value with the new value. D,C: You can use NEW and OLD qualifier with row level triggers, If in the CREATE TRIGGER statement you didn't say FOR EACH ROW then the trigger will be statement level trigger

    Rate this question:

  • 7. 

    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?

    • FOR EACH ROW trigger on the EMP table.

    • Statement-level trigger on the EMP table.

    • FOR EACH ROW trigger on the AUDIT_TABLE table.

    • Statement-level trigger on the AUDIT_TABLE table

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

    Correct Answer
    A. FOR EACH ROW trigger on the EMP table.
    Explanation
    FOR EACH ROW trigger on the updated table(emp) should be create to record each update row in the AUDIT_TABLE.

    Rate this question:

  • 8. 

    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?

    • ACCOUNT_TRANSACTION;

    • RUN ACCOUNT_TRANSACTION

    • START ACCOUNT_TRANSACTION

    • EXECUTE ACCOUNT_TRANSACTION

    Correct Answer
    A. EXECUTE ACCOUNT_TRANSACTION
    Explanation
    To execute the procedure ACCOUNT_TRANSACTION from the SQL Plus prompt, the correct command is EXECUTE ACCOUNT_TRANSACTION. This command will execute the code within the procedure and perform the necessary actions defined in the procedure's body.

    Rate this question:

  • 9. 

    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 comma has been left after the STATS_EXIST_EXCEPTION exception.

    • The STATS_EXIST_EXCEPTION has not been declared as a number.

    • The STATS_EXIST_EXCEPTION has not been declared as an exception.

    • Only predefined exceptions are allowed in the EXCEPTION section.

    Correct Answer
    A. The STATS_EXIST_EXCEPTION has not been declared as an exception.
    Explanation
    The procedure cannot be created successfully because the STATS_EXIST_EXCEPTION has not been declared as an exception. In order to use the exception in the EXCEPTION section, it needs to be explicitly declared.

    Rate this question:

  • 10. 

    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?

    • ALTER TABLE long_tab MODIFY (LONG_COL CLOB);

    • EXECUTE dbms_lob.migrate(long_tab, long_col, clob)

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

    • EXECUTE utl_lob.migrate(long_tab, long_col, clob)

    • EXECUTE utl_manage_lob.migrate(long_tab, long_col, clob)

    Correct Answer
    A. ALTER TABLE long_tab MODIFY (LONG_COL CLOB);
  • 11. 

    Which statement is valid when removing procedures?

    • Use a drop procedure statement to drop a standalone procedure.

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

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

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

    Correct Answer
    A. Use a drop procedure statement to drop a standalone procedure.
    Explanation
    The DROP DROCEDURE statement is used to drop a stand alone procedure Incorrect Answers:
    B: You can't drop a procedure that's inside a package, you have to drop the package, and in this case the whole procedures, functions,... that are inside the packages will be droped.
    C: Same as B.
    D: REUSE SETTINGS is used to to prevent Oracle from dropping and reacquiring compiler switch settings.With this clause, Oracle preserves the existing settings and uses them for the recompilation.

    Rate this question:

  • 12. 

    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?

    • 1

    • 10

    • None

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

    Correct Answer
    A. 1
    Explanation
    The code creates a trigger named "update_emp" that fires after an update operation on the "emp" table. The trigger inserts a single row into the "audit_table" with the current user and the current date. Therefore, regardless of the number of rows updated in the "emp" table, only one row will be inserted into the "audit_table".

    Rate this question:

  • 13. 

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

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

    • ALTER TRIGGERS ON TABLE employees DISABLE;

    • ALTER employees DISABLE ALL TRIGGERS;

    • ALTER TABLE employees DISABLE ALL TRIGGERS;

    Correct Answer
    A. ALTER TABLE employees DISABLE ALL TRIGGERS;
    Explanation
    The correct answer is "ALTER TABLE employees DISABLE ALL TRIGGERS;". This command specifically targets the EMPLOYEES table and disables all triggers associated with it. The other options are incorrect because they either do not target the table or do not disable all triggers.

    Rate this question:

  • 14. 

    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?

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

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

    • The value of DISCOUNT_RATE is set to 1 each time the procedure DISPLAY_PRICE is invoked.

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

    Correct Answer
    A. The value of DISCOUNT_RATE is set to 0. 10 when the package is invoked for first time in a session.
    Explanation
    The correct answer is that the value of DISCOUNT_RATE is set to 0.10 when the package is invoked for the first time in a session. This can be inferred from the code in the package body where DISCOUNT_RATE is assigned the value of 0.10 within the BEGIN-END block. This means that every time the package is invoked for the first time in a session, the value of DISCOUNT_RATE will be set to 0.10.

    Rate this question:

  • 15. 

    Which two programming constructs can be grouped within a package? (Choose two)

    • Cursor

    • Constant

    • Trigger

    • Sequence

    • View

    Correct Answer(s)
    A. Cursor
    A. Constant
    Explanation
    Incorrect Answers
    C: Triggers are objects that we create are created on the tables.
    D: Sequences can't be grouped inside the packages, but we can reference then inside the package.
    E: Views are created and they are database objects, and they can't be grouped inside the packages

    Rate this question:

  • 16. 

    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?

    • DROP gen_email_name;

    • REMOVE gen_email_name;

    • DELETE gen_email_name;

    • DROP FUNCTION gen_email_name;

    Correct Answer
    A. DROP FUNCTION gen_email_name;
  • 17. 

    Examine this function: CREATE OR REPLACE FUNCTION CALC_PLAYER_AVG (V_ID in PLAYER_BAT_STAT.PLAYER_ID%TYPE) RETURN NUMBER IS V_AVG NUMBER; BEGIN SELECT HITS / AT_BATS INTO V_AVG FROM PLAYER_BAT_STAT WHERE PLAYER_ID = V_ID; RETURN (V_AVG); END; Which statement will successfully invoke this function in SQL *Plus?

    • SELECT CALC_PLAYER_AVG(PLAYER_ID) FROM PLAYER_BAT_STAT;

    • EXECUTE CALC_PLAYER_AVG(31);

    • CALC_PLAYER('RUTH');

    • CALC_PLAYER_AVG(31);

    • START CALC_PLAYER_AVG(31)

    Correct Answer
    A. SELECT CALC_PLAYER_AVG(PLAYER_ID) FROM PLAYER_BAT_STAT;
    Explanation
    B. You can't call a function in this way, in this way you can call a procedure, because function must return a value, to call a function using EXECUTE command you should declare a bind variable using the VARIABLE command then assign the value returned from the function to this variable, in the following way: SQL> VARIABLE v_get_value NUMBER SQL> EXECUTE :v_get_value := CALC_PLAYER_AVG(31) PL/SQL procedure successfully completed. SQL> PRINT v_get_value V_GET_VALUE
    C. Again this way can't be use for calling a function in PL/SQL block because the function return a value and this values must be assigned to PL/SQL variable or to bind variable. Like this DECLARE v_get_from_fn NUMBER; BEGIN v_get_from := CALC_PLAYER_AVG(31); END; 1z0-147 /
    D. Same as C.
    E. START is use to execute a script

    Rate this question:

  • 18. 

    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?

    • PROCEDURE combine;

    • PROCEDURE combine (p_no NUMBER);

    • PROCEDURE combine (p_val_1 VARCHAR2, p_val_2 NUMBER;

    • PROCEDURE concat_all (p_num_val VARCHAR2, p_char_val NUMBER);

    Correct Answer
    A. PROCEDURE combine;
    Explanation
    The correct answer is "PROCEDURE combine;" because it matches the existing procedure declarations in the package specification. This declaration does not have any parameters, so it can be added as an overloaded version of the combine procedure.

    Rate this question:

  • 19. 

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

    • Local variables

    • Arguments

    • Boolean variables

    • Substitution variables

    Correct Answer
    A. Arguments
    Explanation
    When creating stored procedures and functions, the construct that allows you to transfer values to and from the calling environment is arguments. Arguments are parameters that are passed into a procedure or function when it is called. These arguments can be used within the procedure or function to perform operations and return values back to the calling environment.

    Rate this question:

  • 20. 

    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?

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

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

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

    • No rows are inserted.

    Correct Answer
    A. EMP_ID LOG_DATE NEW_SALARY ACTION ---------- -------- ---------- ---------- 201 24-SEP-02 14000 NEW SAL 202 24-SEP-02 7000 NEW SAL
    Explanation
    The trigger "Log_salary_increase" is created to insert a new row into the "Emp_log" table whenever there is an update on the "employees" table and the new salary is greater than 1000.0. In the given SQL statement, the condition "Where Department_id = 20M" is incorrect as it should be "Where Department_id = 20". Therefore, the SQL statement will not update any rows in the "employees" table, resulting in no rows being inserted into the "Emp_log" table.

    Rate this question:

  • 21. 

    Which table should you query to determine when your procedure was last compiled?

    • USER_PROCEDURES

    • USER_PROCS

    • USER_OBJECTS

    • USER_PLSQL_UNITS

    Correct Answer
    A. USER_OBJECTS
    Explanation
    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

    Rate this question:

  • 22. 

    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?

    • CALC_TAX

    • INSERT_EMP

    • UPDATE_SAL

    • DELETE_EMP

    • UPDATE_EMP /MANAGE_EMPS

    Correct Answer
    A. UPDATE_SAL
  • 23. 

    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?

    • Row

    • Statement

    • ORACLE FORM trigger

    • Before

    Correct Answer
    A. Row
    Explanation
    The trigger needs to be converted to a Row trigger in order to correct the error.

    Rate this question:

  • 24. 

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

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

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

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

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

    Correct Answer
    A. Insert DBMS_OUTPUT.PUT_LINE statement to view data on the screen when the stored procedure is executed
    Explanation
    To monitor the value of variables in a stored procedure using SQL Plus environment, you can insert DBMS_OUTPUT.PUT_LINE statement in the code. This statement will display the data on the screen when the stored procedure is executed. By including this statement at various points in the code, you can track the values of variables as the procedure is executed, helping you debug the logic and identify any issues.

    Rate this question:

  • 25. 

    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)

    • Add_dept;

    • Add_dept('Accounting');

    • Add_dept(, 'New York');

    • Add_dept(p_location=>'New York');

    Correct Answer(s)
    A. Add_dept;
    A. Add_dept('Accounting');
    A. Add_dept(p_location=>'New York');
    Explanation
    A is correct because both of the parameter have a default values.
    B is correct because here we call the procedure using position notation, and the first parameter for the procedure will have the value 'Accounting', and since the second parameter has a default value then we can skip it, and in this case it will take the default value.
    D is correct because here we are calling the procedure using naming notation, the value 'New York' will go to the parameter p_location, and the parameter p_dept_name will have the default value. The following table list the for passing parameters to a procedure: Incorrect Answer
    C: You can't use this way and assume that the PL/SQL will understand that he should assign the default value for the first parameter. This is incorrect way for calling

    Rate this question:

  • 26. 

    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?

    • USER_PROC_DEPENDS

    • USER_DEPENDENCIES

    • USER_REFERENCES

    • USER_SOURCE

    Correct Answer
    A. USER_DEPENDENCIES
    Explanation
    The USER_DEPENDENCIES dictionary view can be queried to determine the names of the procedures and functions that invoke the CALC_TEAM_AVG function. This view provides information about the dependencies between database objects, including procedures, functions, and packages. By querying this view, you can identify the objects that depend on the CALC_TEAM_AVG function and determine which procedures and functions invoke it.

    Rate this question:

  • 27. 

    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?

    • 1

    • 2

    • 3

    • 4

    • 5

    Correct Answer
    A. 3
    Explanation
    The MANAGE_EMPS package has three public procedures. These procedures are insert_emp, delete_emp, and update_emp. These procedures can be accessed and called by other programs or packages outside of the MANAGE_EMPS package.

    Rate this question:

  • 28. 

    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?

    • Employee 108 has his email name updated based on the return result of the function.

    • The statement fails because functions called from SQL expressions cannot perform DML.

    • The statement fails because the functions does not contain code to end the transaction.

    • The SQL statement executes successfully, because UPDATE and DELETE statements are ignoring in stored functions called from SQL expressions.

    • The SQL statement executes successfully and control is passed to the calling environment

    Correct Answer
    A. The statement fails because functions called from SQL expressions cannot perform DML.
    Explanation
    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.

    Rate this question:

  • 29. 

    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?

    • The trigger fires successfully.

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

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

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

    Correct Answer
    A. The trigger fails because a SELECT statement on the table being updated is not allowed.
    Explanation
    When you try to update a salary value in the EMP table, the trigger fails because a SELECT statement on the table being updated is not allowed. In other words, you cannot perform a SELECT operation on the same table that is being updated in a trigger.

    Rate this question:

  • 30. 

     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?

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

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

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

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

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

    Correct Answer
    A. If you remove the package specification, then the package body is removed.
    Explanation
    If you remove the package specification, then the package body is removed. This means that if the package specification is deleted, both the package body and the stand-alone stored function CALC_HEIGHT will be removed as well. The package specification serves as the interface for the package, defining the public elements, while the package body contains the implementation of those elements. Removing the package specification effectively removes the entire package.

    Rate this question:

  • 31. 

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

    • View

    • Sequence

    • Privilege

    • Procedure

    • Packaged procedure or function

    Correct Answer(s)
    A. View
    A. Sequence
    A. Procedure
    A. Packaged procedure or function
    Explanation
    A dependent procedure or function directly or indirectly references objects such as views, sequences, procedures, and packaged procedures or functions. These objects are related to the dependent procedure or function and are used in its execution or implementation.

    Rate this question:

  • 32. 

    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?

    • When a row is inserted into the EMP table.

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

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

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

    Correct Answer
    A. When the value of the SAL or JOB column in a row is updated in the EMP table.
    Explanation
    The trigger fires when the value of either the SAL or JOB column in a row is updated in the EMP table. It does not matter if any other columns are updated or if both the SAL and JOB columns are updated together. The trigger will still fire as long as either the SAL or JOB column is updated.

    Rate this question:

  • 33. 

    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)

    • EXECUTE UPD_BAT_STAT;

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

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

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

    • RUN UPD_BAT_STAT

    Correct Answer(s)
    A. EXECUTE UPD_BAT_STAT;
    A. EXECUTE UPD_BAT_STAT(V_AB=>10, V_ID=>31);
    Explanation
    The procedure UPD_BAT_STAT is created with two input parameters, V_ID and V_AB, with default values of 10 and 4 respectively. The procedure updates the AT_BATS column in the PLAYER_BAT_STAT table, adding the value of V_AB to the existing value, for the row where PLAYER_ID matches V_ID. It then commits the changes.

    To successfully invoke this procedure in SQL *Plus, the EXECUTE command is used. The first statement, EXECUTE UPD_BAT_STAT;, will invoke the procedure with the default values for V_ID and V_AB. The second statement, EXECUTE UPD_BAT_STAT(V_AB=>10, V_ID=>31);, will invoke the procedure with specific values for V_ID and V_AB.

    Rate this question:

  • 34. 

    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?

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

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

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

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

    Correct Answer
    A. The trigger invokes the procedure audit_action each time a user logs on to the database and adds the username to the audit table.
    Explanation
    The given trigger invokes the procedure audit_action every time a user logs on to the database and adds the username to the audit table. This means that whenever a user logs in, their username will be recorded in the audit table, creating an audit trail of user logins.

    Rate this question:

  • 35. 

    Which view displays indirect dependencies, indenting each dependency?

    • DEPTREE

    • IDEPTREE

    • INDENT_TREE

    • I_DEPT_TREE

    Correct Answer
    A. IDEPTREE
    Explanation
    The correct answer is IDEPTREE. IDEPTREE view displays indirect dependencies by indenting each dependency. This means that it shows the hierarchical relationship between dependencies, making it easier to understand the dependencies of a particular item.

    Rate this question:

  • 36. 

    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?

    • Change the trigger type to a BEFORE DELETE

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

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

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

    Correct Answer
    A. Change the trigger to a statement-level trigger by removing FOR EACH ROW
    Explanation
    Removing the "FOR EACH ROW" clause will change the trigger to a statement-level trigger. In a statement-level trigger, the trigger fires once for each SQL statement, rather than for each row affected by the statement. This change will correct the error because the trigger is currently expecting to work with individual rows, but the DELETE statement is affecting multiple rows at once. By making the trigger a statement-level trigger, it will be able to handle the DELETE statement correctly.

    Rate this question:

  • 37. 

    An internal LOB is _____.

    • A table.

    • A column that is a primary key.

    • Stored in the database.

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

    Correct Answer
    A. Stored in the database.
    Explanation
    An internal LOB refers to a Large Object that is stored within the database. It can be any type of data such as text, images, or videos that are too large to be stored in a regular table column. Storing the LOB in the database allows for efficient management and retrieval of the data, as it is directly accessible through the database system.

    Rate this question:

  • 38. 

    Under which two circumstances do you design database triggers? (Choose two)

    • To duplicate the functionality of other triggers

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

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

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

    Correct Answer(s)
    A. To guarantee that when a specific operation is performed, related actions are performed.
    A. For centralized, global operations that should be fired for the triggering statement, regardless of which user or application issues the statement.
    Explanation
    Database triggers are designed under two circumstances:
    1) To guarantee that when a specific operation is performed, related actions are performed. This means that when a certain event or action occurs in the database, the trigger will automatically execute a set of predefined actions or procedures.
    2) For centralized, global operations that should be fired for the triggering statement, regardless of which user or application issues the statement. This means that the trigger is designed to execute a specific action or set of actions whenever a particular statement is issued, regardless of who or what issues the statement.

    Rate this question:

  • 39. 

    Which two statements about packages are true? (Choose two)

    • Packages can be nested.

    • You can pass parameters to packages.

    • A package is loaded into memory each time it is invoked

    • The contents of packages can be shared by many applications.

    • You can achieve information hiding by making package constructs private

    Correct Answer(s)
    A. The contents of packages can be shared by many applications.
    A. You can achieve information hiding by making package constructs private
    Explanation
    Actually theses are some of the advantages of the package, sharing the package among applications and
    hide the logic of the procedures and function that are inside the package by declaring them in the package
    header and write the code of these procedures and functions inside the package body.
    Incorrect Answers:

    A: Packages can not be nested
    B: Parameters can't be passed to a package; parameters can be passed to procedures and functions only.
    C: By the first time you call a procedure, function, or reference a global variable within the package, the whole package will be loaded into the memory and stay there, so when ever you need to reference any of the package's constructs again you will find it in the memory

    Rate this question:

  • 40. 

    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?

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

    • You need to execute the command EXECUTE FUNCTION calctax;.

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

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

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

    Correct Answer
    A. You need to create a SQL *Plus environment variable X and issue the command EXECUTE :X := CALCTAX(1000);
    Explanation
    When you call a function from SQL*PLUS you need to assign the returned value a bind variable, and you need the EXECUTE command to execute the function

    Rate this question:

  • 41. 

    Which statement about triggers is true?

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

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

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

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

    Correct Answer
    A. You use a database trigger to fire when an INSERT statement occurs
    Explanation
    A database trigger is a stored procedure that automatically executes when a specific event occurs within a database. In this case, the trigger is set to fire when an INSERT statement occurs, meaning that whenever a new record is inserted into the database, the trigger will be activated and execute the specified actions. This allows for automated processes or validations to be performed whenever new data is added to the database.

    Rate this question:

  • 42. 

    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)

    • EXECUTE INSERT_TEAM;

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

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

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

    • EXECUTE INSERT_TEAM (3, 'LONGHORNS');

    Correct Answer(s)
    A. EXECUTE INSERT_TEAM(3, V_NAME=>'LONGHORNS', V_CITY=>'AUSTIN');
    A. EXECUTE INSERT_TEAM(3, 'AUSTIN','LONGHORNS');
    Explanation
    The procedure INSERT_TEAM has three parameters: V_ID, V_CITY, and V_NAME. The first statement EXECUTE INSERT_TEAM(3, V_NAME=>'LONGHORNS', V_CITY=>'AUSTIN') successfully invokes the procedure by passing the values 3, 'LONGHORNS', and 'AUSTIN' to the respective parameters. The second statement EXECUTE INSERT_TEAM(3, 'AUSTIN','LONGHORNS') also successfully invokes the procedure by passing the values 3, 'AUSTIN', and 'LONGHORNS' to the respective parameters.

    Rate this question:

  • 43. 

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

    • HEADER only

    • DECLARATIVE

    • EXECUTABLE and HEADER

    • DECLARATIVE,EXECUTABLE and EXCEPTION HANDLING

    Correct Answer
    A. EXECUTABLE and HEADER
    Explanation
    The RETURN keyword is typically found in the EXECUTABLE section and the HEADER section when creating a function. The EXECUTABLE section contains the code that is executed when the function is called, and the RETURN keyword is used to specify the value that the function will return. The HEADER section contains the function declaration, including the return type of the function. Therefore, both sections are necessary for the presence of the RETURN keyword.

    Rate this question:

  • 44. 

    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?

    • VALIDATE_PLAYER_STAT cannot recompile and must be recreated

    • VALIDATE_PLAYER_STAT is not invalidated

    • VALDIATE_PLAYER_STAT is invalidated

    • VALIDATE_PLAYER_STAT and BB_PACK are invalidated

    Correct Answer
    A. VALIDATE_PLAYER_STAT is not invalidated
    Explanation
    You can greatly simplify dependency management with packages when referencing a package procedure or function from a stand-alone procedure or function.
    If the package body changes and the package specification does not change, the stand-alone procedure referencing a package construct remains valid.
    If the package specification changes, the outside procedure referencing a package construct is invalidated, as is the package body

    Rate this question:

  • 45. 

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

    • A package.

    • A stored function.

    • A stored procedure

    • Another database trigger

    Correct Answer
    A. A stored procedure
    Explanation
    A. Package can't be called, we call a procedure inside the package.
    B. We can't call a function use CALL statement because function must return a value.
    D. Trigger can't be called, they are execute automatically when the trigger event occur.

    Rate this question:

  • 46. 

    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?

    • An statement is not allowed in a subprogram declaration

    • Procedure LOG_EXEC should be declared before any identifiers.

    • Variable v_name should be declared before declaring the LOG_EXEC procedure

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

    Correct Answer
    A. Variable v_name should be declared before declaring the LOG_EXEC procedure
    Explanation
    The code causes an error when compiled because the variable v_name is referenced before it is declared. In the code, the LOG_EXEC procedure is invoked before the declaration of v_name, causing the error. To fix this, the variable v_name should be declared before declaring the LOG_EXEC procedure.

    Rate this question:

  • 47. 

    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?

    • ERROR at line 1:

    • Row is: Row is: Row is:

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

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

    Correct Answer
    A. Row is: 1 Row is: 2 Row is: 3
  • 48. 

    Which one is the correct routine for the utilization order when using dynamic SQL?

    • Open, Parse, Bind, Execute, Fetch, Close

    • Parse, Bind, open, Execute, Close, Fetch

    • Bind, Open, Parse, Execute, Fetch, Close

    • Open, Bind, Parse, Execute, Close, Fetch

    Correct Answer
    A. Open, Parse, Bind, Execute, Fetch, Close
    Explanation
    The correct routine for the utilization order when using dynamic SQL is to first open the connection, then parse the SQL statement, bind the variables, execute the statement, fetch the results, and finally close the connection. This order ensures that the connection is established before processing the SQL statement, and that the necessary variables are bound and results are fetched in the correct order.

    Rate this question:

  • 49. 

    Which two statements describe the state of a package variable after executing the package in which it is declared? (Choose two)

    • It persists across transactions within a session.

    • It persists from session to session for the same user.

    • It does not persist across transaction within a session

    • It persists from user to user when the package is invoked

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

    Correct Answer(s)
    A. It persists across transactions within a session.
    A. It does not persist from session to session for the same user.
    Explanation
    You can keep track of the state of a package variable or cursor, which persists throughout the user session,
    from the time the user first references the variable or cursor to the time the user disconnects.

    1 Initialize the variable within its declaration or within an automatic, one-time-only procedure.
    2 Change the value of the variable by means of package procedures.
    3 The value of the variable is released when the user disconnects. Incorrect Answers

    B: Each session will have its own value for the variables
    C: It persists across the transactions and through the user session.
    D: Each user has his own values and results, because each user has his own users.

    Rate this question:

Quiz Review Timeline (Updated): Mar 21, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 26, 2008
    Quiz Created by
    Sourav005
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.