Take This Oracle PL/SQL(1z0-147) Dumps Test

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 Ranaguha
R
Ranaguha
Community Contributor
Quizzes Created: 3 | Total Attempts: 7,084
| Attempts: 3,786 | Questions: 145
Please wait...
Question 1 / 145
0 %
0/100
Score 0/100
1. You need to remove database trigger BUSINESS_RULE. Which command do you use to remove the trigger in the SQL*Plus environment?

Explanation

The correct answer is "DROP TRIGGER business_rule;". This command is used to remove a trigger in the SQL*Plus environment. The DROP TRIGGER statement is specifically designed to remove triggers from the database.

Submit
Please wait...
About This Quiz
Take This Oracle PL/SQL(1z0-147) Dumps Test - Quiz

Have you practiced all the PL/SQL queries in Oracle? Take this Oracle PL/SQL(1z0-147) Dumps test to see how well you have practiced the queries and commands. This quiz... see morewill help you check your knowledge of queries as well as other facts related to the programming language. With this quiz, you can test your understanding as well as enhance your knowledge with instant feedback. Go for it, and all the best! Try to get a perfect score, as it will boost your confidence.
see less

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

Explanation

The correct command to remove a trigger in the SQL *Plus environment is "DROP TRIGGER business_hour;". This command removes the trigger named "business_hour" from the database.

Submit
3. This statement fails when executed: CREATE OR REPLACE TRI GGER CALC_TEAM_AVG AFTER I NSERT ON PLAYER BEGIN INSERT INTO PLAYER_BATSTAT ( PLAYER_I D, SEASON_YEAR, AT_BATS, HI TS) VALUES ( : NEW. I D, 1 997, 0, 0) ; END; To which type must you convert the trigger to correct the error?

Explanation

The given statement is a row-level trigger because it is triggered after each row is inserted into the PLAYER table. To correct the error, the trigger must be converted to a statement-level trigger. This means that the trigger will be executed once for each statement, regardless of the number of rows affected.

Submit
4. An internal LOB is _____.

Explanation

An internal LOB refers to a large object data type, such as text, image, or binary data, that is stored in the database. It is not a table or a column that is a primary key. Additionally, it is not a file stored outside of the database with an internal pointer to it from a database column. Therefore, the correct answer is that an internal LOB is stored in the database.

Submit
5. The OLD and NEW qualifiers can be used in which type of trigger?

Explanation

The OLD and NEW qualifiers can be used in row level DML triggers. These qualifiers allow access to the old and new values of the affected rows in the trigger body. This is useful when performing actions based on changes made to specific columns in a table. In row level system triggers, statement level DML triggers, row level application triggers, statement level system triggers, and statement level application triggers, the OLD and NEW qualifiers are not available.

Submit
6. 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 ?

Explanation

The code provided is a trigger that is executed after an update on the emp table. It inserts a row into the audit_table with the current user and date. Since the trigger is executed after each update, regardless of the number of rows updated, only one row will be inserted into the audit_table.

Submit
7. Examine this procedure: CREATE OR REPLACE PROCEDURE  DELETE_PLAYER(V_IDIN NUMBER) IS BEGIN DELETE FROM PLAYER WHERE ID =  V_ID EXCEPTION WHEN STATS_EXI TS_EXCEPTI ON THEN DBMS_OUTPUT.  PUT_LINE(Cannotdeletethisplayer, childrecordsexistin PLAYER_BAT_STAT table);END;  What prevents this procedure from being created successfully? 

Explanation

The procedure cannot be created successfully because the STATS_EXIST_EXCEPTION has not been declared as an exception. In PL/SQL, when defining a procedure, any exceptions that are used within the procedure must be declared beforehand. Since STATS_EXIST_EXCEPTION has not been declared, the procedure cannot reference it as an exception.

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

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 occurs in the database, the trigger will automatically execute a set of actions or procedures to ensure data consistency or enforce business rules.
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 respond to a specific statement or event, regardless of who or what initiated it, ensuring consistent behavior across the database.

Submit
9. You create a DML trigger. For the timing information, which is valid with a DML trigger?

Explanation

A DML trigger can be set to execute either before or after a DML operation is performed. In this case, the correct answer is "BEFORE," indicating that the trigger will be executed before the DML operation takes place. This allows the trigger to modify or validate the data before it is inserted, updated, or deleted in the database table.

Submit
10. Which view displays indirect dependencies, indenting each dependency?

Explanation

IDEPTREE is the correct answer because it is the view that displays indirect dependencies, indenting each dependency. This view provides a clear and organized representation of the dependencies by indenting each level, making it easier to understand the relationship between different elements.

Submit
11. 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?

Explanation

To see the actual error message when creating a function in SQL *Plus, you can issue the command "SHOW ERRORS". This command will display the compilation errors that occurred during the creation of the function, allowing you to identify and address any issues in your code.

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

Explanation

The correct answer is the first option: CREATE OR REPLACE TRIGGER check_sal BEFORE UPDATE OF sal ON emp FOR EACH ROW WHEN(NEW.SALOLD.SAL*1.1) BEGIN RAISE_APPLICATION_ERROR(-20508, ‘do not decrease salary nor increase by more than 10%’); END;

This trigger is created before an update is made to the "sal" column in the "emp" table. It uses the WHEN clause to check if the new salary value is greater than the old salary value multiplied by 1.1 (10% increase). If this condition is met, the trigger raises an application error to prevent the update from happening. This ensures that the salary is neither increased by more than 10% at a time nor ever decreased.

Submit
13. 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?

Explanation

You can query the USER_DEPENDENCIES dictionary view to determine the names of the procedures and functions that invoke the CALC_TEAM_AVG function. The USER_DEPENDENCIES view provides information about dependencies between database objects, including procedures and functions. By querying this view, you can identify which objects are dependent on the CALC_TEAM_AVG function and therefore may need to be updated if the arguments of the function are changed.

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

Explanation

The correct answer is "ALTER TABLE employees DISABLE ALL TRIGGERS;" as this command specifically targets the EMPLOYEES table and disables all triggers associated with it. The other options provided are incorrect as they either do not include the "TABLE" keyword or do not specify disabling all triggers.

Submit
15. You need to implement a virtual private database (vpd). In order to have the vpd functionality, a trigger is required to fire when every user initiates a session in the database. What type of trigger needs to be created?

Explanation

A system event trigger needs to be created in order to have the virtual private database (vpd) functionality. This type of trigger fires when every user initiates a session in the database, allowing for the implementation of the vpd.

Submit
16. Which two program declarations are correct for a stored program unit? (Choose two)

Explanation

The two correct program declarations for a stored program unit are:

1) CREATE OR REPLACE FUNCTION tax_amt (p_id NUMBER) RETURN NUMBER
This is a correct declaration for a stored function named tax_amt that takes in a parameter p_id of type NUMBER and returns a value of type NUMBER.

2) CREATE OR REPLACE PROCEDURE tax_amt (p_id NUMBER, p_amount OUT NUMBER)
This is a correct declaration for a stored procedure named tax_amt that takes in two parameters: p_id of type NUMBER and p_amount of type NUMBER. The p_amount parameter is an OUT parameter, meaning it can be used to return a value to the calling program.

Submit
17. 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; ELSIF v_sal < 1000 THEN v_raise := .07; ELSE v_raise := .04; END IF; update_sal(v_raise); END update_emp; 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?

Explanation

The name of the private procedure in this package is UPDATE_SAL.

Submit
18. Which two dopes the INSTEAD OF clause in a trigger identify? (Choose two)

Explanation

The INSTEAD OF clause in a trigger identifies the view associated with the trigger and the event associated with the trigger.

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

Explanation

The type of argument that passes a value from a procedure to the calling environment is the "OUT" argument. When a procedure is called with an OUT argument, it allows the procedure to modify the value of the argument and pass it back to the calling environment. This allows for two-way communication between the procedure and the calling environment.

Submit
20. When creating store procedures and functions which construct allows you to transfer values to and from the calling environment?

Explanation

When creating store procedures and functions, the construct that allows you to transfer values to and from the calling environment is called "Arguments". Arguments are variables that are defined within the procedure or function and can be passed values from the calling environment. These values can then be used within the procedure or function to perform calculations or operations, and the results can be returned back to the calling environment.

Submit
21. 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?

Explanation

The trigger fails because a SELECT statement on the table being updated is not allowed. In Oracle, when a trigger is fired, it cannot contain a SELECT statement on the table that is being updated. This is to prevent any potential conflicts or inconsistencies that may arise from querying the same table that is currently being modified. Therefore, in this scenario, the trigger fails because it violates this restriction.

Submit
22. 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?

Explanation

The trigger "Log_salary_increase" is created to insert a new record into the "Emp_log" table whenever an update is made to the "Salary" column in the "employees" table, and the new salary is greater than 1000.0. In the given SQL statement, the update is only applied to the employees in the department with ID 20. Since the salaries of employees 201 and 202 are increased by 1000.0, which makes their new salaries greater than 1000.0, two new records are inserted into the "Emp_log" table with the corresponding employee IDs, log dates, new salaries, and action as "NEW SAL". Therefore, the result in the "EMP_LOG" table would be:

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

Submit
23. 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 V_PLAYER_AVG NUMBER(4,3); PROCEDURE UPD_PLAYER_STAT V_ID IN NUMBER, V_AB IN NUMBER DEFAULT4, V_HITS IN NUMBER) IS BEGIN UPDATE PLAYER_BAT_STAT SET ADD_BAT=ADD_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 IN 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; 22 Which kind of packaged variables is V_MAX_TEAM_SALARY?

Explanation

V_MAX_TEAM_SALARY is a public packaged variable. Public variables can be accessed and used by other programs or packages outside of the current package.

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

Explanation

A CALL statement inside the trigger body enables you to call a stored procedure. This allows you to execute a set of predefined instructions or actions within the trigger, providing more flexibility and functionality in the trigger's logic. By calling a stored procedure, you can encapsulate complex operations or business logic in a separate module, improving code reusability and maintainability.

Submit
25. Which statement is valid when removing procedures?

Explanation

The correct answer is "Use a drop procedure statement to drop a standalone procedure." This statement is valid because it specifically mentions dropping a standalone procedure, indicating that it is not part of a package. The other options mention dropping procedures that are part of a package and recompiling the package specification or body, which are not relevant to removing standalone procedures. The last option suggests recompiling the procedure instead of using a drop statement, but this is not the most efficient method for removal.

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

Explanation

By inserting the DBMS_OUTPUT.PUT_LINE statement in the stored procedure, the data can be viewed on the screen when the procedure is executed. This statement allows for monitoring of the variable values in real-time as the procedure is being executed. It is a common practice to use DBMS_OUTPUT.PUT_LINE for debugging purposes in SQL Plus environment.

Submit
27. Examine this code: CREATE OR REPLACE PROCEDURE insert_dept (p_location_id NUMBER) IS v_dept_id NUMBER(4); BEGIN INSERT INTO departments VALUES (5, .Education ., 150, p_location_id); SELECT department_id INTO v_dept_id FROM employees WHERE employee_id=99999; END insert_dept; / CREATE OR REPLACE PROCEDURE insert_location ( p_location_id NUMBER, p_city VARCHAR2) IS BEGIN INSERT INTO locations(location_id, city) VALUES (p_location_id, p_city); insert_dept(p_location_id); END insert_location; / You just created the departments, the locations, and the employees table. You did not insert any rows. Next you created both procedures. You new invoke the insert_location procedure using the following command: EXECUTE insert_location (19, .San Francisco .) What is the result in this EXECUTE command?

Explanation

The result of the EXECUTE command is that the locations, departments, and employees tables are empty. This is because the code does not include any INSERT statements to populate the tables with data. Therefore, when the insert_location procedure is invoked, it does not insert any rows into the tables.

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

Explanation

To determine when a procedure was last compiled, you should query the USER_OBJECTS table. This table contains information about all objects owned by the current user, including procedures. The LAST_DDL_TIME column in the USER_OBJECTS table indicates the timestamp of the last compile or modification of the object. Therefore, by querying this table and filtering for the specific procedure, you can retrieve the last compilation time of the procedure.

Submit
29. 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?

Explanation

The correct answer is the third option: CREATE OR REPLACE TRIGGER check_sal BEFORE UPDATE OF sal ON emp FOR EACH ROW WHEN (new.sal old.sal * 1.1) BEGIN RAISE_APPLICATION_ERROR ( - 20508, "Do not decrease salary not increase by more than 10%"); END. This trigger ensures that the salary is not decreased and is not increased by more than 10% at a time. It checks if the new salary is less than the old salary or greater than 10% of the old salary, and if so, it raises an application error with the specified message.

Submit
30. 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?

Explanation

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

Submit
31. What is true about stored procedures?

Explanation

A stored procedure must have at least one executable statement in the procedure body. This means that a stored procedure cannot be empty and must contain at least one statement that can be executed when the procedure is called.

Submit
32. 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) / What does this trigger do?

Explanation

The given trigger, "watch_it", is an "AFTER LOGON" trigger, which means it will be executed after a user logs on to the database. This trigger calls the "audit_action" procedure and passes the "ora_login_user" as the parameter, which represents the username of the user who logged in. The "audit_action" procedure then inserts the username into the "audit" table. Therefore, the trigger invokes the procedure each time a user logs on to the database and adds the username to the audit table.

Submit
33. 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?

Explanation

The DROP FUNCTION gen_email_name; statement removes the function gen_email_name from the database. This statement is used to delete a stored function from the database.

Submit
34. Which four triggering events can cause a trigger to fire? (Choose four)

Explanation

A trigger can be fired when a specific error or any errors occur, when a database is shut down or started up, when a specific user or any user logs on or off, and when a user executes a CREATE or an ALTER table statement. These triggering events can activate a trigger and perform certain actions or operations based on the defined logic within the trigger.

Submit
35. You have created a script file EMP_PROC.SQL that holds the text to create a procedure PROCESS_EMP. You have compiled the procedure for SQL Plus environment by running the script file EMP_PROC.SQL. What happens if there are syntax errors in the procedure PROCESS_EMP?

Explanation

If there are syntax errors in the procedure PROCESS_EMP, the errors will not be displayed automatically. Instead, the user needs to manually issue the SHOW ERRORS command in the SQL Plus environment to see the errors. This command will display the syntax errors that occurred during the compilation of the procedure.

Submit
36. 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?

Explanation

To execute the procedure ACCOUNT_TRANSACTION from the SQL Plus prompt, the correct command is EXECUTE ACCOUNT_TRANSACTION. This command will run the procedure and execute the code within the BEGIN and END blocks of the procedure.

Submit
37. Which code successfully calculates tax?

Explanation

The given answer is the correct code for calculating tax because it defines a function named "calctax" that takes a parameter "p_no" of type NUMBER and returns a value of type NUMBER. Inside the function, it declares a variable "V_sal" of type NUMBER and assigns it the value of "sal" from the "emp" table where "empno" equals the input parameter "p_no". Finally, it returns the calculated tax value by multiplying "V_sal" by 0.05.

Submit
38. 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?

Explanation

The correct answer is a FOR EACH ROW trigger on the EMP table. This type of trigger is used to monitor every row that is changed in the EMP table and perform actions accordingly. It is specifically designed to capture and track changes at the row level.

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

Explanation

The correct routine for the utilization order when using dynamic SQL is to first open the cursor, then parse the SQL statement, bind the variables, execute the statement, fetch the results, and finally close the cursor. This order ensures that the cursor is properly initialized and the SQL statement is correctly processed before executing and retrieving the results.

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

Explanation

The correct answer is Cursor and Constant. In programming, a package is a way to group related constructs together. Cursors are used to retrieve and manipulate data in a database, and constants are used to define values that do not change throughout the program. Both cursors and constants can be grouped within a package to organize and manage them effectively.

Submit
41. What can you do with the DBMS_LOB package?

Explanation

The DBMS_LOB package in a database management system (DBMS) allows users to manipulate large objects (LOBs) such as BFILEs. One of the functionalities provided by this package is the ability to close a file that is being accessed. This is done using the DBMS_LOB.FILECLOSE procedure. By closing the file, the user ensures that no further operations can be performed on it, preventing any potential issues or conflicts.

Submit
42. 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)

Explanation

The code provided is a procedure called "add_dept" that takes two parameters: "p_dept_name" and "p_location". The procedure inserts a new row into the "departments" table with the values provided for "p_dept_name" and "p_location".

The valid calls to the "add_dept" procedure are:

1. add_dept; - This call uses the default values for both parameters.
2. add_dept( .Accounting .); - This call provides a value for "p_dept_name" and uses the default value for "p_location".
3. add_dept(p_location=> .New York .); - This call uses the default value for "p_dept_name" and provides a value for "p_location".

These calls demonstrate different ways to provide values for the parameters of the "add_dept" procedure.

Submit
43. 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)

Explanation

The correct answer is "EXECUTE UPD_BAT_STAT;" and "EXECUTE UPD_BAT_STAT(V_AB=>10, V_ID=>31);". These two statements will successfully invoke the procedure in SQL *Plus. The first statement invokes the procedure with the default values for V_ID and V_AB. The second statement invokes the procedure with specific values for V_ID and V_AB.

Submit
44. Which three are valid ways to minimize dependency failure? (Choose three)

Explanation

Specifying schema names when referencing objects helps to minimize dependency failure by ensuring that the correct object is referenced, even if there are multiple objects with the same name in different schemas. Querying with the SELECT * notification minimizes dependency failure by retrieving all columns from a table, ensuring that any changes to the table's structure are automatically reflected in the query. Declaring variables with the %TYPE attribute minimizes dependency failure by automatically adjusting the variable's data type if the referenced object's data type is changed. Declaring records by using the %ROWTYPE attribute minimizes dependency failure by automatically adjusting the record's structure if the referenced table's structure is changed.

Submit
45. Examine this code:CREATE OR REPLACE PACKAGE bonus IS g_max_bonus NUMBER := .99; FUNCTION calc_bonus (p_emp_id NUMBER) RETURN NUMBER; FUNCTION calc_salary (p_emp_id NUMBER) RETURN NUMBER; END; / CREATE OR REPLACE PACKAGE BODY bonus IS v_salary employees.salary%TYPE; v_bonus employees.commission_pct%TYPE; FUNCTION calc_bonus (p_emp_id NUMBER) RETURN NUMBER IS BEGIN SELECT salary, commission_pct INTO v_salary, v_bonus FROM employees WHERE employee_id = p_emp_id; RETURN v_bonus * v_salary; END calc_bonus FUNCTION calc_salary (p_emp_id NUMBER) RETURN NUMBER IS BEGIN SELECT salary, commission_pct INTO v_salary, v_bonus FROM employees WHERE employees RETURN v_bonus * v_salary + v_salary; END cacl_salary; END bonus; / Which statement is true?

Explanation

The BONUS.CALC_SALARY packaged function can be called from a SELECT command against the EMPLOYEES table. This is because the CALC_SALARY function is defined within the bonus package and can be accessed and executed within a SQL statement.

Submit
46. Which statement about the local dependent object is TRUE?

Explanation

The correct answer is that the local dependent object is on the same node in the same database. This means that the object is located within the same physical server and database as the object it depends on. This indicates a close relationship between the two objects, as they are both stored in the same location.

Submit
47. Examine this package CREATE OR REPLACE PACKAGE PACK_CUR IS CURSOR C1 IS SELECT PRODID FROM PRODUCT ORDER BY PRODID DESC; PROCEDURE PROC1; PROCEDURE PROC2; END PACK_CUR; / CREATE OR REPLACE PACKAGE BODY PACK_CUR IS V_ID NUMBER; PROCEDURE PROC1 IS BEGIN OPEN C1; LOOP FETCH C1 INTO V_PRODID; DBMS_OUTPUT. PUT_LINE (ROW IS :,||C1/ROWCOUNT); EXIT WHEN C1/ROWCOUNT>=3; END LOOP; END PROC1; PROCEDURE PROC2 IS BEGIN LOOP FETCH C1 TO V_PRODID DBMS_OUTPUT. PUT_LINE (ROW IS :,||C1/ROWCOUNT); EXIT WHEN C1/ROWCOUNT>=6; END LOOP; CLOSE C1; END PROC2; END PACK_CUR; / The products table has more than 1000 rows. The SQL plus server output setting is turned on in your session. You execute procedure proc1 fromsql plus with the command: EXECUTE PACK_CUR.PROC1. What is the output in your session?

Explanation

The output in the session will be "Row is:1 Row is:2 Row is:3". This is because in the PROC1 procedure, the cursor C1 is opened and then a loop is executed. In each iteration of the loop, a row is fetched from the cursor and the value of C1/ROWCOUNT is printed using the DBMS_OUTPUT.PUT_LINE function. The loop will continue until C1/ROWCOUNT is greater than or equal to 3. Since the cursor is ordered in descending order by PRODID, the first three rows will be fetched and their values will be printed.

Submit
48. You have created a stored procedure DELETE_TEMP_TABLE that uses dynamic SQL to remove a table in your schema. You have granted the EXECUTE privilege to user A on this procedure. When user A executes the DELETE_TEMP_TABLE procedure, under whose privileges are the operations performed by default?

Explanation

When user A executes the DELETE_TEMP_TABLE procedure, the operations are performed under the privileges of the user who created the procedure. In this case, since you created the procedure, the operations will be performed under your privileges.

Submit
49. 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; DMBS_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?

Explanation

The error in the trigger is caused by the presence of the "FOR EACH ROW" clause. This clause is used for row-level triggers, but in this case, the trigger should be a statement-level trigger. By removing the "FOR EACH ROW" clause, the trigger will be corrected and will no longer result in an error.

Submit
50. Examine this code: CREATE OR REPLACE PACKAGE comm_package 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?

Explanation

At 9:01am, Jones executes the code "EXECUTE comm_package.g_comm := 15", which sets the value of g_comm to 15. Therefore, at 9:06am, g_comm will still have a value of 15 for Jones.

Submit
51. Examine the code examples. Which one is correct?

Explanation

The correct answer is "CREATE OR REPLACE TRIGGER authorize_action BEFORE INSERT ON EMPLOYEES
37
CALL log_exectution; /". This is the correct syntax for creating a trigger in Oracle. The "CREATE OR REPLACE TRIGGER" statement is used to create a new trigger, followed by the trigger name, the timing (BEFORE INSERT), and the table name (EMPLOYEES). The "CALL log_exectution;" statement is used to call a procedure or function within the trigger.

Submit
52. How can you migrate from a LONG to a LOB data type for a column?

Explanation

To migrate from a LONG to a LOB data type for a column, you can use the ALTER TABLE command. This command allows you to modify the structure of a table, including changing the data type of a column. By using the ALTER TABLE command, you can alter the column's data type from LONG to LOB, which is a more modern and flexible data type for handling large amounts of data. This migration process ensures that the column can now store and manage LOB data efficiently.

Submit
53. Local procedure A calls remote procedure B. Procedure B was compiled at 8 A.M. Procedure A was modified and recompiled at 9 A.M. Remote procedure B was later modified and recompiled at 11 A.M. The dependency mode is set to TI MESTAMP. What happens when procedure A is invoked at 1 P.M?

Explanation

When the dependency mode is set to TIMESTAMP, it means that the procedure's timestamp is checked to determine if it needs to be recompiled. In this scenario, procedure A was modified and recompiled at 9 A.M, and procedure B was modified and recompiled at 11 A.M. When procedure A is invoked at 1 P.M, its timestamp will be compared to the timestamp of procedure B, and since procedure B was recompiled after procedure A, procedure A will be invalidated and recompiled for the second time it is invoked.

Submit
54. What part of a database trigger determines the number of times the trigger body executes?

Explanation

The trigger type determines the number of times the trigger body executes. Different trigger types have different behaviors when it comes to execution. For example, a trigger type of "before insert" will execute the trigger body once for each row being inserted, while a trigger type of "after update" will execute the trigger body once for each row being updated. Therefore, the trigger type is what determines the frequency of execution for the trigger body.

Submit
55. Which of the following Oracle supplied package is used to enable HTTP callouts from PL/SQL and SQL to access data on the Internet?

Explanation

UTL_HTTP is the correct answer because it is an Oracle supplied package that enables HTTP callouts from PL/SQL and SQL to access data on the Internet. This package provides procedures and functions to send HTTP requests, receive HTTP responses, and handle HTTP cookies. It allows developers to interact with web services, retrieve data from web pages, and perform other HTTP operations within their PL/SQL and SQL code.

Submit
56. Which procedure of the dbms_output supply package would you use to append text to the current line of the output buffer?

Explanation

The PUT_LINE procedure of the dbms_output supply package is used to append text to the current line of the output buffer. This procedure is commonly used in PL/SQL programs to display output messages. It allows you to append text without starting a new line, which is useful when you want to display multiple messages on the same line.

Submit
57. When creating procedures, local variables and arguments should be placed after which key words?

Explanation

When creating procedures, local variables and arguments should be placed after the "IS" keyword. The "IS" keyword is used to introduce the declaration section of a procedure, where local variables and arguments are defined. This section comes after the procedure name and before the "BEGIN" keyword, which marks the beginning of the executable section of the procedure. Therefore, the correct placement of local variables and arguments is after the "IS" keyword.

Submit
58. Which type of package construct must be declared both within the package specification and package body?

Explanation

Public procedures and functions must be declared both within the package specification and package body. This is because public procedures and functions are intended to be accessed and used by other parts of the program, so their declaration needs to be visible in the package specification. The package body contains the implementation of these public procedures and functions. By declaring them in both the specification and body, they can be properly defined and utilized within the package.

Submit
59. When creating a function in which section will you typically find a return key word?

Explanation

In a function, the return keyword is typically found in the executable and header section. This section contains the body of the function where the actual code is written. The return keyword is used to specify the value that the function should return back to the caller. By using the return keyword, the function can pass the computed result or any other desired value back to the calling code.

Submit
60. What is a condition predicate in a DML trigger?

Explanation

not-available-via-ai

Submit
61. 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?

Explanation

The correct statement to invoke the function in SQL *Plus is "SELECT CALC_PLAYER_AVG(PLAYER_ID) FROM PLAYER_BAT_STAT;". This statement calls the function CALC_PLAYER_AVG and passes the PLAYER_ID column from the PLAYER_BAT_STAT table as the argument. It will return the average calculated by the function for each player in the table.

Submit
62. Examine this package 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?

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 package body where the BEGIN statement sets the value of DISCOUNT_RATE to 0.10.

Submit
63. 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 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?

Explanation

The given package BB_PACK does not have a public variable named V_PLAYER_AVG. It only has a private variable V_PLAYER_AVG declared in the package body. Private variables cannot be accessed or assigned a value from outside of the package. Therefore, the correct answer is that the variable cannot be assigned a value from outside of the package.

Submit
64. 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_HITS WHERE 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; Which statement will successfully assign $75,000,000 to the V_MAX_TEAM_SALARY variable from within a stand-alone procedure?

Explanation

The correct answer is "BB_PACK.V_MAX_TEAM_SALARY := 75000000;". This statement successfully assigns the value of $75,000,000 to the V_MAX_TEAM_SALARY variable within the BB_PACK package.

Submit
65. Given a function CALCTAX : CREATE OR REPLACE FUNCTION calc tax (sal NUMBER) RETURN NUMBER IS BEGIN RETURN (sal * 0.05); END; If you want to run the above function from the SQL *Plus prompt, which statement is true?

Explanation

To run the given function from the SQL *Plus prompt, you need to create a SQL *Plus environment variable X and then use the EXECUTE command to assign the result of the function to the variable X. The correct statement is EXECUTE :X := CALCTAX(1000);. This will execute the function CALCTAX with the argument 1000 and assign the result to the variable X.

Submit
66. The creation of which four database objects will cause a DDL trigger to fire? (Choose four)

Explanation

When an Index, Package, Function, or Synonym is created, it will cause a DDL (Data Definition Language) trigger to fire. DDL triggers are used to perform actions in response to changes in the database schema, such as the creation or modification of objects. In this case, the creation of these four objects will trigger the DDL trigger to execute any associated actions or code.

Submit
67. 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?

Explanation

A local subprogram defined within the program unit ORDERTOTAL is the most appropriate location to store the code that calculates the discounts. This ensures that the code is easily accessible and can be invoked from within the program unit ORDERTOTAL. Storing the code as a local subprogram also promotes modularity and encapsulation, as it keeps the code closely related to the program unit it is being used in.

Submit
68. Which statement about triggers is true?

Explanation

not-available-via-ai

Submit
69. 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?

Explanation

The correct statement to successfully invoke the UPD_BAT_STAT procedure in the given procedure is "UPD_BAT_STAT(V_ID);". This statement directly calls the UPD_BAT_STAT procedure with the parameter V_ID.

Submit
70. Examine the trigger heading CREATE OR REPLACE TRIGGER SALARY_CHECK Before update (sal,job) on emp For each row Under what conditions does this trigger fire?

Explanation

This trigger will fire when the value of the SAL or JOB column in a row is updated in the EMP table. It will not fire when a row is inserted or when any other column in the row is updated.

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

Explanation

The first statement, "EXECUTE INSERT_TEAM (3, V_NAME=>'LONGHORNS', V_CITY=>'AUSTIN');" will successfully invoke the procedure because it provides the correct values for the parameters V_ID, V_NAME, and V_CITY.

The second statement, "EXECUTE INSERT_TEAM (3, 'AUSTIN', 'LONGHORNS');" will also successfully invoke the procedure because it provides the correct values for the parameters V_ID, V_CITY, and V_NAME.

Submit
72. Which Oracle supply package allows you to run jobs at use defined times?

Explanation

The correct answer is DBMS_JOB. DBMS_JOB is an Oracle supply package that allows users to schedule and run jobs at specified times. It provides a way to automate tasks within the Oracle database by defining jobs and setting their execution times. With DBMS_JOB, users can schedule recurring jobs, specify intervals between job executions, and manage job dependencies. This package is commonly used for tasks such as data loading, report generation, and data transformation.

Submit
73. 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?

Explanation

The construct that has a forward declaration is CALC_ORD. This is because it is declared as a procedure in the package body before it is defined or implemented. The forward declaration allows the procedure to be referenced and called before it is fully defined, which can be useful in certain cases where procedures need to call each other in a specific order.

Submit
74. Examine this trigger. CREATE OR REPLACE TRIGGER UPD_TEAM_SALARY AFTER INSERT OR UPDATE OR DELETE ON PLAYER FOR EACH ROW BEGIN UPDATE TEAM SET TOT_SALARY=TOT_SALARY+:NEW SALARY. WHERE ID=:NEW:TEAM_ID; You will be adding additional coat later but for now you want the current block to fire when updated the salary column. Which solution should you use to verify that the user is performing an update on the salary column?

Explanation

The correct solution to verify that the user is performing an update on the salary column is UPDATING('SALARY'). This is because the UPDATING() function is used to check if a specific column is being updated in the trigger. In this case, 'SALARY' is the column being checked, so UPDATING('SALARY') will return true if the salary column is being updated and false otherwise.

Submit
75. The programmer view developed a procedure ACCOUNT_TRANSACTION left organization. You were assigned a task to modify this procedure. YOU want to find all the program units invoking the ACCOUNT_TRANSACTION procedure. How can you find this information?

Explanation

To find all the program units invoking the ACCOUNT_TRANSACTION procedure, you can query the USER_DEPENDENCIES data dictionary views. This view contains information about the dependencies between database objects, including procedures. By querying this view, you can retrieve a list of all program units that depend on the ACCOUNT_TRANSACTION procedure, indicating which program units are invoking it.

Submit
76. Which two describe a stored procedure? (Choose two)

Explanation

A stored procedure is a named PL/SQL block that can accept parameters, meaning it can be given a specific name and can take in input values. It is also a type of PL/SQL subprogram that performs an action, indicating that it is designed to execute a specific task or set of tasks.

Submit
77. You want to execute a procedure from SQL Plus. However you are not sure of the argument list for this procedure. Which command will display the argument list?

Explanation

The DESCRIBE command in SQL Plus is used to display the argument list for a procedure. It provides information about the name, data type, and size of each argument in the procedure. By using the DESCRIBE command, you can easily determine the argument list and execute the procedure with the correct arguments.

Submit
78. To be callable from a SQL expression, a user-defined function must do what?

Explanation

A user-defined function must be stored only in the database in order to be callable from a SQL expression. This means that the function must be created and saved within the database system, rather than being stored externally or in a different location. Storing the function in the database allows it to be accessed and executed within the SQL environment, making it available for use in SQL expressions.

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

Explanation

A package variable persists across transactions within a session, meaning that its value is retained and can be accessed throughout the duration of the session, even if multiple transactions are executed. However, it does not persist from session to session for the same user, meaning that the variable's value is not retained when the user ends their current session and starts a new one.

Submit
80. Which two statements about packages are true? (Choose two)

Explanation

Packages in programming languages such as Java can be nested, meaning that one package can be contained within another package. This allows for better organization and structure of code. Additionally, packages can be shared by many applications, meaning that multiple programs can access and use the contents of a package. This promotes code reuse and modularity. Information hiding can also be achieved in packages by making certain constructs, such as variables or methods, private. This restricts access to these constructs from outside the package, enhancing encapsulation and data protection.

Submit
81. Examine this package: 29 CREATE OR REPLACE PACKAGE manage_emps IS Tax_rate CONSTRAINT NUMBER(5,2):=. 28; v_id NUMBER; PROCEDURE insert_emp(p_dept NO NUMBER, p_sal NUMBER); PROCEDURE delete_emp; PROCEDURE update_emp; FUNCTION calc_text(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_AMP)+SAL WHERE EMPNO=v_id; END; PROCEDURE insert_emp (p_deptno NUMBER,p_sal NUMBER) IS BEGIN INSERT INTO EMP(EMPNO,DEPTNO,SAL) VALUES(v_id,p_deptno,p_sal); INERT INTO EMP; PROCEURE delete_emp IS BEGIN DELETE FROM EMP WHERE EMPNO=v_id; END delete_emp; PROCEDURE audit_emp; IS V_sal NUMBER(10,2); V_raise NUMBER(10,2); IS SELECT SAL INTO v_sal FROM EMP WHERE EMPNO=v_id; IF v_sal<500 THEN v_raise:=. 05;ELSE v_sal<1000 THEN v_raise:=. 07;ELSE v_raise:=. 04; END IF; update_sal (v_raise); END update_emp; FUNCTION calc_tax (p_sal NUMBER) RETURN NUMBER IS BEGIN RETURN p_sal*tax_rate; END calc_tax; 30 END manage_emps; / How many public procedures are there in the MANAGE_EMPS package?

Explanation

The correct answer is 3. There are three public procedures in the MANAGE_EMPS package: insert_emp, delete_emp, and update_emp. These procedures are declared with the PROCEDURE keyword and can be accessed and called from outside the package.

Submit
82. 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 11 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?

Explanation

If the structure of the newly created CUSTOMER table is the same as the public synonym CUSTOMER table, the procedure PROCESS_CUSTOMER will successfully recompile and access the data from the newly created table. This is because the procedure is designed to process customer information from the public synonym CUSTOMER table, and if the structure of the new table matches that of the public synonym, the procedure can still access the data without any compilation errors.

Submit
83. 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); BEGIN v_email_home := 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; You run this SELECT statement: SELECT first_name, last_name gen_email_name(first_name, last_name, 108) EMAIL FROM employees; What occurs?

Explanation

not-available-via-ai

Submit
84. Examine this package: CREATE OR REPLACE PACKAGE BB:PACK IS V_MAX_TEAM:SALAR 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_HITS WHERE 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?

Explanation

When the body of a package is recompiled, it does not automatically invalidate any standalone procedures that reference the package. Therefore, in this scenario, the standalone procedure VALIDATE_PLAYER_STAT will not be invalidated and does not need to be recreated.

Submit
85. Which type of argument passes a value from a calling environment?

Explanation

The "IN" type of argument passes a value from a calling environment. This means that the value is passed into the called function or subroutine, allowing it to be used within the called code. The calling environment provides the value to be passed, and the called function can then manipulate or use that value as needed.

Submit
86. Examine this package specification: CREATE OR REPLACE PACKAGE concat_all IS V_string VARCHER2(100); PROCEDURE combine(p_num_val NUMBER); PROCEDURE combine (p_dateval DATE); PROCEDURE combine(p_char_val VARCHER2,p_num_val NUMBER); END concat_all; / 31 Which overloaded COMBINE procedure declaration can be added to this package specification?

Explanation

The correct answer is "PROCEDURE combine;" because it matches the existing procedure declarations in the package specification. It does not have any parameters, which means it is a different overloaded version of the "combine" procedure.

Submit
87. 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?

Explanation

DBMS_PIPES is the correct answer because it is an Oracle supplied package that allows communication between different sessions connected to the same instance. It provides functionality for sending messages and data between sessions using named pipes.

Submit
88. 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)

Explanation

The given code is creating a procedure called "add_dept" with two parameters, "p_name" and "p_loc". The "p_name" parameter has a default value of ".unknown" and the "p_loc" parameter has a default value of 1700. The procedure inserts a new row into the "departments" table using the values passed as parameters.

The four valid invocations of the "add_dept" procedure are:

1. EXECUTE add_dept(p_loc=>2500): This invocation passes a value of 2500 for the "p_loc" parameter, using the named parameter syntax.

2. EXECUTE add_dept('Education', 2500): This invocation passes the values 'Education' and 2500 for the "p_name" and "p_loc" parameters, respectively.

3. EXECUTE add_dept('2500', p_loc =>2500): This invocation passes the values '2500' and 2500 for the "p_name" and "p_loc" parameters, respectively.

4. EXECUTE add_dept(p_loc=>2500, p_name=>'Education'): This invocation passes a value of 2500 for the "p_loc" parameter and 'Education' for the "p_name" parameter, using the named parameter syntax.

Submit
89. The number of cascading triggers is limited by which data base initialization parameter?

Explanation

The number of cascading triggers is limited by the "OPEN_CURSORS" database initialization parameter. This parameter determines the maximum number of open cursors that can be used by a session. Since cascading triggers involve the execution of multiple triggers in a sequence, each trigger execution may require the use of a cursor. Therefore, the maximum number of open cursors indirectly limits the number of cascading triggers that can be executed.

Submit
90. In order for you to create run a package MAINTAIN_DATA which privilege do you need?

Explanation

To create and run a package called MAINTAIN_DATA, you need the EXECUTE privilege on the MAINTAIN_DATA package. This privilege allows you to execute the package and its associated program units. It does not require any additional privileges on the program units or objects accessed by the package.

Submit
91. What happens during the execute phase with dynamic SQL for INSERT, UPDATE, and DELETE operations?

Explanation

During the execute phase with dynamic SQL for INSERT, UPDATE, and DELETE operations, the SQL statement is executed and the number of rows processed is returned. This means that the actual operation of inserting, updating, or deleting data from the database is performed, and the result of this operation is the number of rows that were affected or processed.

Submit
92. Examine this procedure: CREATE OR REPLACE PROCEDURE ADD_PLAYER (V_ID IN NUMBER, V_LAST_NAME VARCHER2(30)) IS BEGIN INSERT INTO PLAYER(ID, LAST_NAME) VALUES(V_ID, V_LAST_NAME); COMMIT; END; Why does this command fail when executed?

Explanation

When declaring arguments in a procedure, each argument must have a length specified. In this case, the argument V_LAST_NAME is missing the length specification. Therefore, the command fails when executed.

Submit
93. Examine this trigger: CREATE OR REPLACE TRIGGER CHECK_TOT_SALARY AFTER INSERT OR UPDATE OF SALARY ON PLAYER FOR EACH ROW DECLARE V_TOT_SALS NUMBER(12, 2); BEGIN SELECT SUM(SALARY) INTO V_TOT_SAL FROM PLAYER WHER TEAM_ID=:NEW. SALARY; END; Why does this trigger fail when inserting a row into player table?

Explanation

The trigger fails when inserting a row into the player table because it tries to read data from the same table that is being affected by the trigger. This creates a conflict and the trigger is unable to retrieve the necessary information.

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

Explanation

The correct answer is PRAGMA RESTRICT_REFERRENCES. This compiler directive is used to check the purity level of functions. Purity refers to the side effects of a function, such as modifying global variables or performing I/O operations. By using this pragma, the compiler can enforce restrictions on the functions to ensure they are pure and do not have any side effects. This can help in optimizing code and improving program reliability.

Submit
95. Which two tables are fused track object dependencies? (Choose two)

Explanation

The two tables that are fused track object dependencies are USER_DEPENDENSIES and IDEPTREE. These tables are likely used to store information about the dependencies between different objects in a system or database. By tracking these dependencies, it becomes easier to understand how changes to one object might impact other objects, allowing for better management and maintenance of the system.

Submit
96. The ADD_PLAYER procedure inserts rows into the player table. Which command will show this direct dependency?

Explanation

The correct answer is "SELECT * FROM USER_DEPENDENCIES WHERE REFFERENCE_NAME= ‘PLAYER’;". This query will show the direct dependency of the "PLAYER" table in the user_dependencies view. It will display any objects that depend on the "PLAYER" table, including the "ADD_PLAYER" procedure that inserts rows into the table.

Submit
97. Examine this code: CREATE OR REPLACE PROCEUDRE AUDIT_EMP; (P_ID IN EMP. EMPNO%TYPE) IS V_ID NUMBER; PROCEDURE LOG_EXEC IS BEGIN INSERT INTO LOG_TABLE (USER_ID,LOG_DATE) VALUES (USERS,SYSDATE); END LOG_EXEC V_NAME VARCHAR2(20) BEGIN DELECT FROM EMP WHERE EMPNO = P_ID; LOG_EXEC; SELECT ENAME,EMPNO INTO V_NAME,V_ID FROM EMP WHERE EMPNO=P_ID END AUDIT_EMP; Why does this code cause and error when compiled?

Explanation

The code causes an error when compiled because the V_NAME variable should be declared before declaring the LOG_EXEC procedure. In PL/SQL, variables and procedures must be declared before they are used. In this code, the LOG_EXEC procedure is called before the V_NAME variable is declared, which is not allowed. To fix this error, the V_NAME variable should be declared before the LOG_EXEC procedure.

Submit
98. Examine this package CREATE OR REPLACE PACKAGE COMPILE_THIS IS G_VALUE VARCHAR2(100); PROCEDURE A; PROCEDURE B; END COMPILE_THIS; / CREATE OR REPLACE PACKAGE BODY COMPILE_THIS IS PROCEDURE A IS BEGIN G_VALUE := ('HELLO WORLD'); END A; PROCEDURE B IS BEGIN C; DBMS_OUTPUT. PUT_LINE ('PROCEDURE B CALLING C'); END B; PROCEDURE C IS BEGIN B; DBMS_OUTPUT. PUT_LINE ('PROCEDURE C CALLING B'); END; END COMILE_THIS; / Procedure C is a local construct to the package. What happens when this package is compiled?

Explanation

When the package is compiled, it will produce a compilation error because procedure C requires a forward declaration. Procedure C is called in procedure B before it is defined, so a forward declaration is needed to resolve this issue. Without a forward declaration, the compiler will not be able to recognize the procedure C when it is called in procedure B, resulting in a compilation error.

Submit
99. 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; SELECTS HITS/AT_BATS INTO V_AVG FROM PLAYER_BAT_STAT WHERE PLAYER_ID_V_ID; RETURN(V_AVG); END; This function must be moved to a package. Which additional statement must be added to the function to allow you to continue using the function in the group by the clause of a select statement?

Explanation

The correct additional statement that must be added to the function is PRAGMA RESTRICT_REFERENCES (CALC_PLAYER_AVG, WNDS, WNPS). This pragma is used to specify the purity level of a function and allows the function to be used in the GROUP BY clause of a select statement.

Submit
100. Which two dictionary views track dependencies? (Choose two)

Explanation

The DEPTREE_TEMPTAB and USER_DEPENDENCIES dictionary views track dependencies. DEPTREE_TEMPTAB is a temporary table that stores the dependencies between objects in the database. USER_DEPENDENCIES is a view that provides information about the dependencies between objects owned by the current user. By querying these views, you can determine which objects depend on each other and track the dependencies within the database.

Submit
101. Which command must you issue to allow users to access the UPD_TEAM_STAT trigger on the TEAM table?

Explanation

The correct answer is "GRANT SELECT, INSERT, UPDATE, DELETE ON TEAM TO PUBLIC;" This command grants the SELECT, INSERT, UPDATE, and DELETE privileges on the TEAM table to all users in the database. By issuing this command, users will be able to access and modify the data in the TEAM table.

Submit
102. Which statement is true?

Explanation

Stored functions can increase the efficiency of queries by performing functions in the query rather than in the application. This means that instead of retrieving data from the database and then performing functions on it in the application, the functions are executed directly within the query, reducing the amount of data that needs to be transferred and processed. This can lead to improved performance and faster query execution times.

Submit
103. Examine this trigger: CREATE OR REPLACE TRIGGER UPD_PLAYER_STAT_TRIG AFTER INSERT ON PLAYER FOR EACH ROW BEGIN INSERT INTO PLAYER_BAT_STAT(PLAYER_ID, SEASON_YEAR,AT_BATS,HITS) VALUES(player_id_seq.currval, 1997, 0, 0 ); END; After creating this trigger, you test it by inserting a row into the PAYER table. You receive this error message: ORA-04091: table SCOTT.PLAYER is mutating,trigger/function may not see it. How can you avoid getting this error?

Explanation

The error message "ORA-04091: table SCOTT.PLAYER is mutating,trigger/function may not see it" occurs because the trigger is trying to access the table PLAYER while it is being modified. To avoid this error, the foreign key constraint on the PLAYER_ID column of the PLAYER_BAT_STAT table should be dropped. This will prevent the trigger from referencing the PLAYER table during the insert operation, allowing it to execute successfully without the mutating table error.

Submit
104. Examine this package: CREATE OR REPLACE PACKAGE pack_cur IS CURSOR c1 IS SELECT prodid FROM product ORDER BY Prodid DESC; PROCEDURE Proc1; PROCEDURE Proc2; END pack_cur; / CREATE OR REPLACE PACKAGE BODY pack_cur IS v_prodif NUMBER; PROCEDURE proc1 IS 35 BEGIN OPEN C1; LOOP PROCEDURE proc2 IS BEGIN LOOP FETCH C1 INTO v_prodid; DBMS_OUTPUT-PUT_LINE ( ' Row is: ' ll c1 %ROWCOUNT); EXIT WHEN C1%ROWCOUNT >= 3; END LOOP; END Procl; / 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; You then execute the procedure PROC2 from SQL *Plus with the command: EXECUTE pack_cur. PROC2; What is the output in your session from the PROC2 procedure?

Explanation

The output from the PROC2 procedure is "Row is: 4, Row is: 5, Row is: 6". This is because the PROC2 procedure contains a loop that fetches rows from the cursor C1 until the C1%ROWCOUNT is greater than or equal to 3. Since the PROC1 procedure was executed before PROC2, it already fetched the first 3 rows from the cursor. Therefore, when PROC2 is executed, it starts fetching from the 4th row onwards, resulting in the output "Row is: 4, Row is: 5, Row is: 6".

Submit
105. The PROCEDURE_ADD_PRODUCT is defined within a package specifications as follows: PROCEDURE_ADD_PRODUCT (P_PRODNO NUMBER,P_PRODNAME VARCHER2); Which procedure declaration can't be added to package specifications?

Explanation

The procedure declaration "PROCEDURE add_product (p_prize NUMBER, P_DESCRIPTION VARCHER2);" cannot be added to the package specifications because it contains a spelling mistake. The correct datatype for VARCHAR2 is misspelled as "VARCHER2".

Submit
106. Which two statements about the overloading feature of packages are true? (Choose two)

Explanation

The overloading feature of packages allows for the creation of different subprograms with the same name but different in either the number or type or order of parameters. This means that multiple subprograms can have the same name, but they can be distinguished by their parameters. Additionally, only local or packaged subprograms can be overloaded, meaning that subprograms from other packages cannot be overloaded.

Submit
107. Which two statements about packages are true? (Choose two)

Explanation

The first statement is true because a package specification is required in order to define the interface of the package, while the package body is optional and is used to provide the implementation details.

The fifth statement is also true because the specification and body of the package are stored separately in the database. This allows for easier management and version control of the package components.

Submit
108. Examine the trigger Create a replace trigger cascade_updates After update (Deptno) on Dept For each row BEGIN UPDATE EMP SET emp_deptno=: new. Deptno WHERE emp.Deptno=: old.Deptno; END When this trigger will fire successfully?

Explanation

The trigger will fire successfully when there is no referential integrity between the dept number columns of the emp and the dept tables within their table definitions. This means that the trigger will be able to update the emp_deptno column in the EMP table based on the old.Deptno value in the Dept table, regardless of any constraints or relationships between the two tables.

Submit
109. 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?

Explanation

not-available-via-ai

Submit
110. You are creating a stored procedure in the SQL Plus environment. The text of the procedure is stored in a script file. You run the script file to compile the procedure. What happens if the procedure contains syntax error?

Explanation

If the procedure contains a syntax error, both the source code and the compilation errors are stored in the database. This means that the SQL Plus environment will store the entire source code of the procedure, including the syntax error, in the database. Additionally, the compilation errors that are generated as a result of the syntax error will also be stored in the database. This allows for easy access to both the source code and the errors for debugging and troubleshooting purposes.

Submit
111. The QUERY_PRODUCT procedure directly references the product table. There is a NEW_PRODUCT_VIEW view created based on the NOT NULL columns of the table. The ADD_PRODUCT procedure updates the table indirectly by the way of NEW_PRODUCT_VIEW view. Under which circumstances does the procedure ADD_PRODUCT get invalidated but automatically get complied when invoked?

Explanation

If a new column that can contain null values is added to the product table, the NEW_PRODUCT_VIEW view will become invalid because it is based on the NOT NULL columns of the table. However, the ADD_PRODUCT procedure will automatically recompile when invoked because it indirectly updates the table through the view. Therefore, even though the view is invalidated, the procedure can still be executed without any manual intervention.

Submit
112. You need to create a stored procedure, which deletes rows from a table. The name of the table from which the rows are to be deleted is unknown until run time. Which method do you implement while creating such a procedure?

Explanation

The correct answer is to use DBMS_SQL packaged routines in the procedure to delete the rows. This method allows for the table name to be unknown until run time, as it provides dynamic SQL capabilities. With DBMS_SQL, you can build and execute SQL statements dynamically, including the delete statement, without needing to know the table name in advance. This provides flexibility and allows for the deletion of rows from any table specified at run time.

Submit
113. Which system privileges must you have to manually recompile a stored procedure owned by another application developer?

Explanation

To manually recompile a stored procedure owned by another application developer, you must have the system privilege "ALTER ANY PROCEDURE". This privilege allows you to modify any procedure in the database, regardless of the owner. The other options listed, such as "ALTER PROCEDURE" and "ALTER ALL PROCEDURE", do not grant the necessary privilege to modify procedures owned by other developers. The privilege "COMPILE ANY PROCEDURE" allows you to compile any procedure in the database, but it does not grant the ability to make other modifications to the procedure.

Submit
114. Which statement about the forward declarations is true?

Explanation

Forward declarations allow you to use mutually referential subprograms in a package. This means that you can have subprograms that refer to each other before they are fully defined. This can be useful in cases where two or more subprograms need to call each other, but their full definitions are not available at the time of declaration. By using forward declarations, you can resolve the circular reference and ensure that the subprograms can call each other successfully.

Submit
115. Under which situation do you create a server side procedure?

Explanation

When the procedure needs to be used by many users accessing the same schema objects on a local database, it is necessary to create a server-side procedure. This allows multiple users to access and execute the procedure, ensuring consistency and efficiency in accessing and manipulating the shared schema objects. By creating a server-side procedure, the logic and functionality can be centrally managed and maintained, providing a standardized approach for all users accessing the database.

Submit
116. Which allows a PL/SQL user define a function?

Explanation

The HAVING clause is used in conjunction with the GROUP BY clause to filter the results of a query based on a condition. It allows the PL/SQL user to define a function by specifying a condition that must be met by the grouped data. This clause is commonly used to perform calculations or apply aggregate functions to the grouped data and then filter the results based on the calculated values. Therefore, the HAVING clause is the correct option for allowing a PL/SQL user to define a function.

Submit
117. Which data dictionary views gives you the names and the source code of all the procedures that you have created?

Explanation

The correct answer is USER_SOURCE. This data dictionary view provides the names and source code of all the procedures that the user has created. It is a useful tool for developers to access and analyze their own code. The other options, USER_OBJECTS, USER_PROCEDURES, and USER_SUBPROGRAMS, do not specifically provide the source code of the procedures.

Submit
118. The ADD_PLAYER, UPD_PLAYER_STAT and UPD_PITCHER_STAT procedures are grouped together in a package. A variable must be shared among only these procedures. Where should you declare this variable?

Explanation

In this scenario, the correct place to declare the variable that needs to be shared among the ADD_PLAYER, UPD_PLAYER_STAT, and UPD_PITCHER_STAT procedures is in the package body. The package body is where the implementation of the procedures and functions defined in the package specification is written. By declaring the variable in the package body, it can be accessed and used by all the procedures within the package.

Submit
119. CREATE OR REPLACE PROCEDURE manage_emp(p_eno NUMBER) IS V_sal emp.sal%TYPE; V_job emp.job%TYPE; BEGIN SELECT sal,job INTO v_sal,v_job FROM emp WHERE empno=p_eno; IF(v_sal<1000)THEN DBMS_OUTPUT.PUT_LINE('Delete employees who earn less than$1000'); DELETE FROM emp WHERE empno=p_eno; ELSE DBMS_OUTPUT.PUT_LINE('Updating employee salaries.'); UPDATE emp SET sal=sal+100 WHERE empno=p_eno; END IF; END; / What privileges do you need in order to invoke this procedure?

Explanation

To invoke this procedure, the user needs the EXECUTE privilege on the procedure. This privilege allows the user to execute the procedure and perform the operations within it. No additional privileges such as DELETE, UPDATE, or privileges on the DBMS_OUTPUT package are required in this case.

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

Explanation

A dependent procedure or function directly or indirectly references views, sequences, procedures, and packaged procedures or functions. These objects are necessary for the dependent procedure or function to perform its tasks correctly. Privileges and anonymous blocks are not mentioned as objects that are directly or indirectly referenced by dependent procedures or functions, so they are not included in the answer.

Submit
121. Which script file must be executed before you can determine indirect independence's using the DEPTREE AND IDEPTREE VIEWS?

Explanation

The script file that needs to be executed before determining indirect independence using the DEPTREE AND IDEPTREE VIEWS is UTLDTREE.SQL.

Submit
122. Which two statements are true? (Choose two)

Explanation

A function must return a value because that is the purpose of a function - to perform a specific task and return a result. A function is invoked as part of an expression because it can be used within an expression to perform a calculation or operation.

Submit
123. You need to recompile several program units you have recently modified through a PL/SQL program. Which statement is true?

Explanation

The correct answer is that you can use the DBMS_DDL.ALTER_COMPILE packaged procedure to recompile the program units. This procedure allows you to recompile program units that have been modified through a PL/SQL program.

Submit
124. The DBMS_DDL package provides access from within PL/SQL to:

Explanation

The DBMS_DDL package in PL/SQL provides access to two Data Definition Language (DDL) statements. This package allows users to perform operations such as creating, altering, and dropping database objects like tables, indexes, and views. It provides a convenient way to execute DDL statements within PL/SQL code, making it easier to manage and manipulate the database structure.

Submit
125. Examine this package: CREATE OR REPLACE PACKAGE BB_PACK V_MAX_TEAM_SALARY NUMBER(12,2); PROCEDURE ADD_PLAYER(V_ID IN NUMBER, V_LAST_NAME VARCHAR2, V_SALARY NUMBER); DB_PACK;/ CREATE OR REPLACE PACKAGE BODY BB_PACK IS V_WHERE_AVG NUMBER(4,3); PROCEDURE UPD_PLAYER_STAT (V_ID IN NUMBER, V_AVG 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; An outside procedure VALIDATE_PLAYER_STAT is executed from this package. 23 What will happen when this procedure changes?

Explanation

When the outside procedure VALIDATE_PLAYER_STAT is executed from this package, it will invalidate the package body. This means that any dependent objects or references to the package body will become invalid and need to be recompiled. The package specification, on the other hand, will remain unaffected by the execution of the outside procedure.

Submit
126. All users currently have the INSERT privileges on the PLAYER table. You want only your users to insert into this table using the ADD_PLAYER procedure. Which two actions must you take? (Choose two)

Explanation

To ensure that only your users can insert into the PLAYER table using the ADD_PLAYER procedure, you need to take the following two actions:

1. Grant the EXECUTE privilege on the ADD_PLAYER procedure to the PUBLIC role. This allows all users to execute the ADD_PLAYER procedure.
2. Revoke the INSERT privilege on the PLAYER table from the PUBLIC role. This prevents all users from directly inserting into the PLAYER table.

By granting the EXECUTE privilege on the ADD_PLAYER procedure and revoking the INSERT privilege on the PLAYER table, you restrict the ability to insert into the table only through the ADD_PLAYER procedure, ensuring that only your users can perform the desired operation.

Submit
127. 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, 34 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)

Explanation

The CREATE PROCEDURE statement fails because the declaration of the format parameter p_margin cannot have a DEFAULT clause and the declaration of the format parameter p_bonus_percent cannot have a DEFAULT clause.

Submit
128. Which situation requires a before update statement level trigger on the table?

Explanation

A before update statement level trigger on the table is required when you need to make sure that the user making modifications to the table has the necessary privileges. This trigger can be used to check the user's privileges before allowing the modification to take place.

Submit
129. Which statements are true? (Choose all that apply)

Explanation

If errors occur during the compilation of a trigger, the trigger is still created. This means that even if there are errors in the code of the trigger, it will still be created in the database.

If errors occur during the compilation of a trigger, you can use the SHOW ERRORS command within iSQL *Plus to see the compilation errors. This command allows you to view the specific errors that occurred during the compilation process.

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. The USER_ERRORS view provides information about the errors that occurred during the compilation of database objects, including triggers.

Submit
130. 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?

Explanation

In Oracle, it is not possible to drop just the package specification while retaining the package body. The package specification and body are considered as a single unit and cannot be separated. So, the correct answer is that you cannot accomplish this task.

Submit
131. Examine this code: 39 CREATE OR REPLACE STORED FUNCTION get_sal (p_raise_amt NUMBER, p_employee_id employees.employee_id%TYPE) RETURN NUMBER 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?

Explanation

not-available-via-ai

Submit
132. What happens during the parse phase with dynamic SQL?

Explanation

During the parse phase of dynamic SQL, the validity of the SQL statement is established. This means that the database system checks whether the syntax of the SQL statement is correct and whether the objects referenced in the statement exist. If the SQL statement is found to be valid, it can proceed to the next phases of execution. If the statement is not valid, an error will be returned, indicating that the SQL statement needs to be corrected before it can be executed.

Submit
133. 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)

Explanation

To see the names of the procedures and other functions that invoke the My_Func function in the Oracle database, you would query the ALL_DEPENDENCIES and USER_DEPENDENCIES data dictionary views. These views contain information about the dependencies between database objects, including functions, procedures, and packages. By querying these views, you can identify which procedures and functions are dependent on the My_Func function and determine if any changes to the function's arguments will affect other parts of the application.

Submit
134. Which three are true statements about dependent objects? (Choose three)

Explanation

1. Invalid objects cannot be described: This statement is true because when an object is invalid, it means that it has compilation errors and cannot be described or accessed until the errors are fixed.
2. The Oracle server automatically records dependencies among objects: This statement is true because Oracle automatically tracks dependencies between objects. If one object depends on another object, any changes made to the referenced object will be recorded and the dependent object will be marked as invalid.
3. You can view whether an object is valid or invalid in the USER_OBJECTS data dictionary view: This statement is true because the USER_OBJECTS data dictionary view provides information about all objects in the current user's schema, including their validity status.

Submit
135. 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)

Explanation

The first statement is false because the Oracle Server records both the timestamp and the signature for each PL/SQL program unit, not just the signature. The second statement is true because using the signature mode of dependency allows remote procedures to be recompiled without affecting the dependent local procedures, thus preventing unnecessary recompilation.

Submit
136. Which three statements are true regarding database triggers? (Choose three)

Explanation

Database triggers are PL/SQL blocks, C, or Java procedures that are associated with a table, view, schema, or the entire database. They can be executed implicitly whenever a specific event occurs. These events can be data events like DML operations or system events like logon or shutdown. Triggers can fire for each event on a schema or database, depending on their association.

Submit
137. You need to drop a table from within a stored procedure. How do you implement this?

Explanation

The DBMS_SQL packaged routines can be used in a stored procedure to dynamically execute SQL statements. By using these routines, you can construct and execute a DROP TABLE statement within the procedure to drop the table. This allows for flexibility and dynamic execution of SQL statements within the procedure.

Submit
138. Examine the following statement: CREATE OR REPLACE TRIGGER Check_sal BEFORE UPDATE OF SALARY ON EMPLOYEES for each ROW WHEN (NEW.salary < OLD. Salary OR NEW.Salary > OLD.salary * 1.2) BEGIN RAISE_APPLICATION_ERROR(-20004,'You cannot increase salary by more than 10% nor can you decrease it'); END; What will happen when you execute the statement?

Explanation

The statement will execute successfully and the trigger will be created. However, it is possible that the trigger will fail when the salary column of the Employees table is updated. This is because the trigger is checking if the new salary is either less than the old salary or greater than 1.2 times the old salary. If this condition is met, the trigger will raise an application error. Therefore, if the salary is updated in a way that violates this condition, the trigger will fail.

Submit
139. Which statement is true?

Explanation

Server side procedures are stored in script files on the server. This means that the procedures are saved as separate files on the server's file system. This allows for easy management and organization of the procedures. Additionally, storing the procedures in script files allows for version control and easy deployment to other servers.

Submit
140. You have an AFTER UPDATE row-level trigger on the table EMP. This trigger queries the EMP table and inserts the updating users information into the AUDIT_TABLE. What happens when the users update rows on the EMP table?

Explanation

When users update rows on the EMP table, a run time error occurs. This means that there is an error during the execution of the trigger. As a result, both the effect of the trigger body and the triggering statement are rolled back. This means that any changes made by the trigger and the update statement are not applied to the EMP table.

Submit
141. Examine this code: CREATE OR REPLACE FUNCTION gen_email_name (p_first VARCHAR2, p_last VARCHAR2) RETURN VARCHAR2 IS 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?

Explanation

The given code defines a function called "gen_email_name" that takes two parameters, p_first and p_last, both of type VARCHAR2. The function returns a string value of type VARCHAR2. The function concatenates the first character of p_first, the first seven characters of p_last, and an unknown value, and assigns it to the variable v_email_name. Finally, the function returns the value of v_email_name.

From the code, it can be inferred that the function will only work correctly if the two parameters passed in are not null values. Additionally, the function will generate a string based on the two character values passed into the function. Therefore, the two statements that are true are: "This function can be used only if the two parameters passed in are not null values" and "This function will generate a string based on 2 character values passed into the function."

Submit
142. Which of the following statements about LOB are true? (Choose Three)

Explanation

LOB (Large Object) is a data type used to store large, unstructured data. It can be stored either inside or outside a database. Additionally, there is a category of LOB known as Internal LOB.

Submit
143. Which three are true regarding error propagation? (Choose three)

Explanation

An exception cannot propagate across remote procedure calls because exceptions are not transmitted across different systems or processes. The use of the RAISE; statement in an exception handler reprises the current exception, meaning that it re-raises the same exception that was caught. An exception raised inside an exception handler immediately propagates to the enclosing block, meaning that it is passed up to the next level of exception handling.

Submit
144. Why do stored procedures and functions improve performance? (Chose two)

Explanation

Stored procedures and functions improve performance by postponing PL/SQL parsing until run time, which means that the parsing process is not executed until the procedure or function is actually called. This helps to reduce the overhead and improve the overall performance of the database system. Additionally, stored procedures and functions reduce the number of calls to the database and decrease network traffic by bundling multiple commands together, allowing them to be executed in a single call. This minimizes the communication overhead and improves the efficiency of the system.

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

Explanation

When changes are applied to the package specification of a stored sub-program, it is true that only the package specification requires recompilation. The package specification defines the interface or public API of the package, so any changes to it may affect the way other programs interact with the package. However, the package body, which contains the implementation details of the sub-program, does not need to be recompiled unless there are changes made to it directly.

Submit
View My Results

Quiz Review Timeline (Updated): Aug 28, 2023 +

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

  • Current Version
  • Aug 28, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 21, 2013
    Quiz Created by
    Ranaguha
Cancel
  • All
    All (145)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
You need to remove database trigger BUSINESS_RULE. Which command do...
You need to remove the database trigger BUSINESS_HOUR . Which command...
This statement fails when executed:...
An internal LOB is _____.
The OLD and NEW qualifiers can be used in which type of trigger?
Examine this code: CREATE OR REPLACE TRIGGER update_emp AFTER UPDATE...
Examine this procedure: CREATE OR REPLACE PROCEDURE  ...
Under which two circumstances do you design database triggers? (Choose...
You create a DML trigger. For the timing information, which is valid...
Which view displays indirect dependencies, indenting each dependency?
When creating a function in SQL *Plus, you receive this message:...
Which code can you use to ensure that the salary is neither increased...
You are about to change the arguments of the CALC_TEAM_AVG function....
You need to disable all triggers on the EMPLOYEES table. Which command...
You need to implement a virtual private database (vpd). In order to...
Which two program declarations are correct for a stored program unit?...
Examine this package: ...
Which two dopes the INSTEAD OF clause in a trigger identify? (Choose...
Which type of argument passes a value from a procedure to the calling...
When creating store procedures and functions which construct allows...
You have a row level BEFORE UPDATE trigger on the EMP table. This...
You have the following table:...
Examine this package...
A CALL statement inside the trigger body enables you to call ______.
Which statement is valid when removing procedures?
Debug the logic in a stored procedure. How do you monitor the value of...
Examine this code:...
Which table should you query to determine when your procedure was last...
Which code can you use to ensure that the salary is not increased by...
You disabled all triggers on the EMPLOYEES table to perform a data...
What is true about stored procedures?
Examine this code:...
Examine this code:...
Which four triggering events can cause a trigger to fire? (Choose...
You have created a script file EMP_PROC.SQL that holds the text to...
Given the header of a procedure ACCOUNT_TRANSACTION:CREATE OR...
Which code successfully calculates tax?
You need to create a trigger on the EMP table that monitors every row...
Which one is the correct routine for the utilization order when using...
Which two programming constructs can be grouped within a package?...
What can you do with the DBMS_LOB package?
Examine this code:CREATE OR REPLACE PRODECURE add_dept (p_dept_name...
Examine this procedure:...
Which three are valid ways to minimize dependency failure? (Choose...
Examine this code:CREATE OR REPLACE PACKAGE bonus IS...
Which statement about the local dependent object is TRUE?
Examine this package...
You have created a stored procedure DELETE_TEMP_TABLE that uses...
Examine the trigger:...
Examine this code:...
Examine the code examples. Which one is correct?
How can you migrate from a LONG to a LOB data type for a column?
Local procedure A calls remote procedure B. Procedure B was compiled...
What part of a database trigger determines the number of times the...
Which of the following Oracle supplied package is used to enable HTTP...
Which procedure of the dbms_output supply package would you use to...
When creating procedures, local variables and arguments should be...
Which type of package construct must be declared both within the...
When creating a function in which section will you typically find a...
What is a condition predicate in a DML trigger?
Examine this function:...
Examine this package ...
Examine this package:...
Examine this package: CREATE OR REPLACE PACKAGE BB_PACK IS...
Given a function CALCTAX : CREATE OR REPLACE FUNCTION calc tax (sal...
The creation of which four database objects will cause a DDL trigger...
You want to create a PL/SQL block of code that calculates discounts on...
Which statement about triggers is true?
Examine this procedure: CREATE OR REPLACE PROCEDURE ADD_PLAYER (V_ID...
Examine the trigger heading...
Examine the procedure: ...
Which Oracle supply package allows you to run jobs at use defined...
Examine this package body:...
Examine this trigger....
The programmer view developed a procedure ACCOUNT_TRANSACTION left...
Which two describe a stored procedure? (Choose two)
You want to execute a procedure from SQL Plus. However you are not...
To be callable from a SQL expression, a user-defined function must do...
Which two statements describe the state of a package variable after...
Which two statements about packages are true? (Choose two)
Examine this package:...
There is a CUSTOMER table in a schema that has a public synonym...
Examine this code:CREATE OR REPLACE FUNCTION gen_email_name...
Examine this package: CREATE OR REPLACE PACKAGE BB:PACK IS...
Which type of argument passes a value from a calling environment?
Examine this package specification:...
You want to send a message to another session connected to the same...
Examine this code: CREATE OR REPLACE PROCEDURE add_dept ( p_name...
The number of cascading triggers is limited by which data base...
In order for you to create run a package MAINTAIN_DATA which privilege...
What happens during the execute phase with dynamic SQL for INSERT,...
Examine this procedure:...
Examine this trigger:...
Which compiler directive to check the purity level of functions?
Which two tables are fused track object dependencies? (Choose two)
The ADD_PLAYER procedure inserts rows into the player table. Which...
Examine this code:...
Examine this package...
Examine this function...
Which two dictionary views track dependencies? (Choose two)
Which command must you issue to allow users to access the...
Which statement is true?
Examine this trigger:...
Examine this package:...
The PROCEDURE_ADD_PRODUCT is defined within a package specifications...
Which two statements about the overloading feature of packages are...
Which two statements about packages are true? (Choose two)
Examine the trigger...
Examine this code:CREATE OR REPLACE TRIGGER secure_emp BEFORE LOGON ON...
You are creating a stored procedure in the SQL Plus environment. The...
The QUERY_PRODUCT procedure directly references the product table....
You need to create a stored procedure, which deletes rows from a...
Which system privileges must you have to manually recompile a stored...
Which statement about the forward declarations is true?
Under which situation do you create a server side procedure?
Which allows a PL/SQL user define a function?
Which data dictionary views gives you the names and the source code of...
The ADD_PLAYER, UPD_PLAYER_STAT and UPD_PITCHER_STAT procedures are...
CREATE OR REPLACE PROCEDURE manage_emp(p_eno NUMBER)...
A dependent procedure or function directly or indirectly references...
Which script file must be executed before you can determine indirect...
Which two statements are true? (Choose two)
You need to recompile several program units you have recently modified...
The DBMS_DDL package provides access from within PL/SQL to:
Examine this package:...
All users currently have the INSERT privileges on the PLAYER table....
CREATE OR REPLACE PROCEDURE set_bonus...
Which situation requires a before update statement level trigger on...
Which statements are true? (Choose all that apply)
You work as an application developer for federal Inc. the company uses...
Examine this code:...
What happens during the parse phase with dynamic SQL?
You work as an application developer for federal Inc. the company uses...
Which three are true statements about dependent objects? (Choose...
You work as an application developer for Dolliver Inc. The company...
Which three statements are true regarding database triggers? (Choose...
You need to drop a table from within a stored procedure. How do you...
Examine the following statement:...
Which statement is true?
You have an AFTER UPDATE row-level trigger on the table EMP. This...
Examine this code:...
Which of the following statements about LOB are true? (Choose Three)
Which three are true regarding error propagation? (Choose three)
Why do stored procedures and functions improve performance? (Chose...
If there is any changes applied to the package specification or body...
Alert!

Advertisement