databases Online Quiz - 34
|Description: databases Online Quiz - 34
|Number of Questions: 20
|Created by: Aliensbrain Bot
What SYSTEM VARIABLE is used to refer DATABASE TIME ?
Which is the true statements about dependent objects?
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?
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 is invalid call to the add_dep procedure? (Choose three
To answer this question, the user needs to understand the concept of package variables in PL/SQL.
Package variables are variables that are declared in the package specification and can be accessed by any subprogram or procedure defined in the package. The state of a package variable after executing the package depends on its type.
Option A is correct. Package variables persist across transactions within a session. This means that the value of a package variable remains the same during the lifetime of the session, even if multiple transactions are executed. The value of the variable can be changed by any subprogram or procedure defined in the package.
Option B is incorrect. Package variables do not persist from session to session for the same user. When a user logs out of the session and logs back in, the package variable is reinitialized with its default value.
Option C is incorrect. Package variables persist across transactions within a session. The value of a package variable remains the same during the lifetime of the session, even if multiple transactions are executed.
Option D is incorrect. Package variables do not persist from user to user when the package is invoked. When a different user invokes the package, the package variable is reinitialized with its default value.
Therefore, the correct answer is:
The Answer is: A
Which table should you query to determine when your procedure was last compiled?
To determine when your procedure was last compiled, you should query the USER_OBJECTS table.
Let's analyze each option to understand why the correct answer is C:
Option A) USER_PROCEDURES - This option is incorrect because the USER_PROCEDURES table does not provide information about when a procedure was last compiled. It contains information about procedures owned by the current user, but not the compilation timestamp.
Option B) USER_PROCS - This option is incorrect because there is no standard Oracle table named USER_PROCS. It is not a valid table in the Oracle database.
Option C) USER_OBJECTS - This option is correct because the USER_OBJECTS table contains information about all objects owned by the current user, including procedures. It includes a LAST_DDL_TIME column that represents the timestamp of the last DDL (Data Definition Language) operation performed on the object, which includes the compilation of a procedure.
Option D) USER_PLSQL_UNITS - This option is incorrect because the USER_PLSQL_UNITS table stores information about PL/SQL units, such as packages, functions, and procedures. However, it does not specifically provide information about when a procedure was last compiled.
The correct answer is C) USER_OBJECTS. This table should be queried to determine when your procedure was last compiled because it includes the necessary information in the LAST_DDL_TIME column.
"A student has such attributes as name, address, and gender. A student can also attend a graduate, undergraduate, or elective class that has the following attributes: class name, section name, major, and instructor. Based on the scenario above, which is the composite key in a junction table if many students can attend many classes?