14 Oracle Supplied Packages
14 Oracle Supplied Packages
DBMS_COMPILE.MODIFIED
DBMS_SQL.ALTER_COMPILE
DBMS_RECOMPILE.INVALID
DBMS_DDL.ALTER_COMPILE
Explanation:
DBMS_DDL is an Oracle supplied package that allows you to perform Data Definition
Language (DDL) commands within a PL/SQL construct.
ALTER_COMPILE is one procedure of this package that allows you to compile PL/SQL
constructs.
DBMS_JOB
DBMS_DDL
DBMS_PIPE
DBMS_OUTPUT
Explanation:
DBMS_JOB is an Oracle supplied package that allows you to create jobs or
schedules. These jobs are created by specifying the time to execute, iteration, and the
action or actions to perform.
Explanation:
DBMS_JOB is the Oracle supplied package that allows you to execute procedures or
schedule tasks to execute intermittently.
You could invoke the procedure manually each day at 7:00 am, but it is not the best answer
for this scenario.
PUT
PLACE_LINE
OUTPUT_LINE
CREATE_LINE
Explanation:
DBMS_OUTPUT is an Oracle supplied package that allows you to display messages during
a SQL*Plus session. PUT is the procedure within this package that allows you to add text to
the buffer only. You can then display the contents of the buffer using the PUT_LINE or
NEW_LINE procedure. PUT_LINE is a procedure within this package that places a line of
text into a buffer and then displays the contents of the buffer to the screen. NEW_LINE is a
procedure within this package that places an end-of-line marker in the output buffer.
To view the results of the DBMS_OUTPUT package in SQL*Plus, you must first issue the
SET SERVEROUTPUT ON command.
SET ECHO ON
SET VERIFY ON
SET FEEDBACK ON
SET SERVEROUTPUT ON
Explanation:
DBMS_OUTPUT is an Oracle supplied package that allows you to display messages during
a SQL*Plus session. To view the execution results of DBMS_OUTPUT in SQL*Plus, you
must first issue the SET SERVEROUTPUT ON command.
When using DBMS_SQL to create dynamic SQL, which processing phase will
check the validity of the statement?
bind
parse
fetch
execute
Explanation:
When a SQL statement is processed, it must pass through the parse, bind, execute, and
fetch phases.
During the parse phase, the statement is checked for syntax errors and validity. All object
references are resolved and the user's privileges to those objects are checked.
When invoking the Oracle supplied DBMS_SQL package, under which user
account are the operations executed?
SYS only
SYSTEM only
current user only
SYS and current user only
Explanation:
Operations performed with DBMS_SQL are executed under the current user. They are not
executed under the SYS or SYSTEM accounts.
Which two Oracle supplied packages can you use to perform DDL commands
within a PL/SQL program unit? (Choose two.)
DBMS_SQL
DBMS_JOB
DBMS_DDL
DBMS_PIPE
DBMS_OUTPUT
Explanation:
DBMS_SQL is an Oracle supplied package that allows you to perform Data Definition
Language commands (DDL) within a PL/SQL construct. It also allows you to create dynamic
SQL.
DBMS_DDL is an Oracle supplied package that allows you to perform certain Data Definition
Language (DDL) commands within a PL/SQL construct.
Explanation:
Data Definition Language (DDL) commands cannot be executed from within a PL/SQL
construct unless you use the DBMS_SQL package.
Data Manipulation Language (DML) commands can be executed directly without the need of
a package.
Which Oracle supplied package allows you to send a message to another user of
the same session?
DBMS_SQL
DBMS_JOB
DBMS_PIPE
DBMS_MESSAGE
Explanation:
DBMS_PIPE is the Oracle supplied package that allows two or more sessions connected to
the same instance to communicate through a pipe.
You use several subprograms within this package to create, send, accept, and read the
contents of a pipe.
A procedure must insert rows into a table. The name of this table is not known
until runtime. Which Oracle supplied package must you use to accomplish this
task?
DBMS_SQL
DBMS_PIPE
DBMS_INSERT
DBMS_DYNAMIC
Explanation:
DBMS_SQL is an Oracle supplied package that allows you to perform Data Definition
Language commands (DDL) within a PL/SQL construct. It also allows you to create dynamic
SQL.
Dynamic SQL is a statement that is not complete in the source code. It is not completed
until runtime. For example, the name of a table could be passed through a parameter and
used to complete the INSERT statement within this procedure.
Which function of the DBMS_SQL package returns the total number of rows
affected by the last operation?
PARSE
EXECUTE
FETCH_ROWS
OPEN_CURSOR
Explanation:
The EXECUTE function of the DBMS_SQL package executes the SQL statement and
returns the number of rows processed.
The PARSE procedure of the DBMS_SQL package immediately parses the SQL statement
specified.
The FETCH_ROWS function of the DBMS_SQL package fetches a row or rows from an
open cursor.