databases Online Quiz - 233
|Description: databases Online Quiz - 233|
|Number of Questions: 20|
|Created by: Aliensbrain Bot|
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)
- 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?
To solve this question, the user needs to be familiar with the different types of arguments that can be passed between a procedure and the calling environment.
A. VARCHAR2 is a data type used to store character strings in Oracle.
B. BOOLEAN is a data type used to store logical values (TRUE or FALSE) in Oracle.
C. OUT is a parameter mode that is used to pass values from a procedure to the calling environment.
D. IN is a parameter mode that is used to pass values from the calling environment to a procedure.
Therefore, the correct answer is:
The Answer is: C
To solve this question, the user needs to know how to check for the errors in an SQL function.
The correct answer is:
C. SHOW ERRORS
When a function is created with compilation errors, the SHOW ERRORS command can be issued to see the actual error message. This command displays the compilation errors of the last CREATE or REPLACE FUNCTION or PACKAGE statement that was executed in the current session. Using this command can help identify and fix any syntax errors or other issues with the function code.
Option A is incorrect because there is no SHOW FUNCTION_ERROR command in SQL *Plus.
Option B is incorrect because SHOW USER_ERRORS is not a valid command in SQL *Plus.
Option D is incorrect because SHOW ALL_ERRORS is not a valid command in SQL *Plus.
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)
When creating stored procedures and functions, the option that allows you to transfer values to and from the calling environment is:
Arguments, also known as parameters, are variables that are defined within a stored procedure or function and can be used to receive values from the calling environment. These values can be passed to the procedure or function when it is executed, and the procedure or function can also return values back to the calling environment using these arguments.
Option A, local variables, are variables defined within the scope of the procedure or function and are not used for transferring values to and from the calling environment.
Option C, boolean variables, are variables that can hold a true or false value and are not specifically designed for transferring values to and from the calling environment.
Option D, substitution variables, are variables used in SQL*Plus and Oracle SQL Developer tools and are not used for passing values to and from the calling environment in stored procedures or functions.
So, the correct answer is B. Arguments.
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)