Oracle PL/SQL Programming
This test contains the P/L SQL basic programming questions, which are useful for CS and GATE aspirants.
Questions
Which of the following DBMS_OUTPUT subprograms retrieves an array of lines from the buffer?
- DBMS_OUTPUT.GET_LINE (line OUT VARCHAR2, status OUT INTEGER);
- DBMS_OUTPUT.GET_LINES (lines OUT CHARARR, numlines IN OUT INTEGER);
- DBMS_OUTPUT.PUT(item IN VARCHAR2);
- DBMS_OUTPUT.PUT_LINE(item IN VARCHAR2);
- DBMS_OUTPUT.DISABLE;
Which of the following events performs the ROLLBACK automatically in a PL/SQL transaction?
- A CREATE TABLE statement is issued
- A COMMIT or a ROLLBACK statement is issued
- A DCL statement, such as a GRANT statement is issued
- A DML statement fails
- An UPDATE statement is issued
What is the necessary condition for the Automatic Transaction Control in Oracle PL/SQL?
- The DML commands will be executed automatically by using this control.
- SET AUTOCOMMIT; is used to create AUTOCOMMIT environment variable.
- To split a long transaction into smaller units by setting some check points.
- It is used to manage the changes in the database.
- It is used to make the transaction safe.
Which of the following scenarios is not possible for User-defined Exception in P/L SQL?
- This exception must be raised explicitly.
- DBMS_STANDARD.RAISE_APPLICATION_ERROR procedure is used to raise this exception.
- This exception cannot be raised automatically when a program violates database rules or exceeds system-dependent limits.
- This exception caused the memory problems in the database.
- These exceptions are created according to user's requirement.
What is the necessary condition to execute a Standalone Procedure?
- By using the EXECUTE keyword, one can execute these procedures.
- By calling the method of the procedure from a PL/SQL block.
- By providing external command.
- By triggering the procedure.
- By synchronising the procedure.
Which of the following is incorrect about Stored Procedure in P/L SQL?
- It is a procedure to manage one or more tasks at a time.
- EXECUTE [or EXEC] procedure_name; can be used to execute the procedure.
- procedure_name; can be used to execute the procedure.
- One can pass parameters to procedures in three ways.
- The header consists of the name of the procedure and the parameters declaration section of the procedure.
Which of the following is the incorrect statement about the subprogram of PL/SQL block structure?
- Declarative part is optional part.
- Executable part is mandatory part.
- Exception-handling part is mandatory.
- The structure of a function is like that of a procedure.
- The procedures are made for these subprograms.
A declared cursor variable is not responsible for _______ in Oracle P/L SQL.
- REF CURSOR type stores the RECORD type of cursor variables.
- The compiler does not allow the weak type of cursor variables for queries.
- Strong REF CURSOR types are less error-prone than weak types but less flexible.
- The compiler allows only the weak types cursor variables for queries.
- The compiler provides the specification of all the variables.
Which of the following is called the security technique(s) while Committing Transactions in Oracle P/L SQL?
- It makes the changes permanent and affects the savepoints.
- The changes are not final.
- The changes are not visible to other users of the database instance.
- The newest Database Express Edition issues an implicit COMMIT statement before and after any data definition language (DDL) statement.
- The data restoration process will be at one point.
Which of the following is correct about IN OUT parameter in P/L SQL?
- This parameter does not return an updated value each time for the subprogram.
- This parameter returns a value to the calling program.
- It can be assigned a value and its value can be read.
- The actual parameter corresponding to an IN OUT formal parameter can be a constant.
- The parameter values cannot be changed.
Which of the following is the incorrect statement about the P/L SQL package in the database?
- A package in a PL/SQL unit is a combination of related programs.
- Packages allow you to hide implementation details from client programs.
- It does not allow client programs to access the database only by invoking PL/SQL subprograms.
- The package subprograms must be qualified with package names when invoked from outside the package.
- The package subprograms are arranged in a well defined module for each user.
Identify the action that makes the transaction safe in Rolling Back Transactions in Oracle P/L SQL?
- Ends the transaction
- Reverses all of its changes
- Erases all of its savepoints
- Releases any transaction locks
- Undo the changes
Which of the following assumptions that the DBA can apply during changing process, triggers in Oracle P/L SQL?
- In order to change a trigger, use either the SQL Developer tool Edit or the DDL statement.
- The triggers state cannot be changed for the list of schema object types.
- Triggers cannot be changed in the list of triggers.
- Trigger cannot be used for managing the database operations in a frequent manner.
- Triggers can be used for data synchronisation.
Identify the correct statement about Triggers in Oracle P/L SQL?
- A system trigger cannot be defined on a schema or the database.
- It is fired for each event associated with the owner of the schema (the current user).
- It is fired before the triggering event executes.
- It is fired after each row that the event affects.
- Triggers are fired when storage of data is performed.
Which of the following is correct about SUBSCRIPT_BEYOND_COUNT exception in Oracle P/L SQL?
- When subscript exceeds the number of elements in a collection.
- When a subscript is outside the allowed range.
- When a subscript is null or not convertible to the key type.
- When the user tries to operate on an atomically null collection.
- When the user tries to check the authenticated value for the particular type.