Top 100 Pl/Sql objective type question and answer

 

 

Try below basic query,Execute it and check the output.

1. An exception defined in the inner block can be raised in

 

a. both inner and outer blocks.

 

b. the outer block only.

 

c. the inner block only.

 

ans. C

 

 

2. An exception defined inside the body of the loop

 

a. terminates this loop after it has been raised.

 

b. allows the loop to proceed with next iteration.

 

c. causes an error.

 

ans. B

 

 

3. In order to use a user-defined exception, it must be

 

a. declared.

 

b. declared and raised.

 

ans. B

 

 

4. How does any user-defined exception get raised?

 

a. Implicitly

 

b. Explicitly

 

ans. B

 

 

5. If a procedure has an IN parameter, then it must have an OUT parameter.

 

a. True

 

b. False

 

ans. C

 

 

6. The view USER_SOURCE only contains the code of valid procedures.

 

a. True

 

b. False

 

ans. C

 

 

7. Which of the following sections is mandatory for a PL/SQL block?

 

a. Exception-handling section

 

b. Executable section

 

c. Declaration section

 

ans. B

 

 

8. SQL statements combined into PL/SQL blocks cause an increase in the network traffic.

 

a. True

 

b. False

 

ans. B

 

 

9. The exception-handling section in a PL/SQL block is used to

 

a. handle compilation errors.

 

b. handle runtime errors.

 

c. handle both compilation and runtime errors.

 

ans. B

 

 

10. A PL/SQL compiler can detect

 

a. syntax errors.

 

b. runtime errors.

 

c. both compilation and runtime errors.

 

ans. A

 

 

11. P-code is stored in the database for

 

a. anonymous PL/SQL blocks.

 

b. named PL/SQL blocks.

 

ans. B

 

 

12. PUT_LINE is one of the procedures from the DBMS_OUTPUT package.

 

a. True

 

b. False

 

ans. A

 

 

13. The SET command SET SERVEROUTPUT ON SIZE 8000 is used to

 

a. enable the DBMS_OUTPUT.PUT_LINE statement only.

 

b. change the buffer size only.

 

c. enable the DBMS_OUTPUT.PUT_LINE statement and change the buffer size.

 

ans. C

 

 

14. The initialization section of a package refers to

 

a. another term for the package header.

 

b. the first part of the package.

 

c. the executable code at the end of the package.

 

d. the evolutionary rudiments in code that are left over from programming methods of cavemen.

 

ans. C

 

 

15. Which of the following are acceptable types of parameters to be used with cursors?

 

a. IN

 

b. OUT

 

c. %ROWTYPE

 

d. IN OUT

 

ans A, B, D

 

%ROWTYPE is only used with declaration of variables.

 

 

 

16. By adding the keywords FOR UPDATE at the end of a cursor, you are

 

a. simply alerting the DBA that you are updating a table.

 

b. freeing up rollback segments for the update.

 

c. locking the indicated rows for an update.

 

d. creating a bind variable.

 

ans. C

 

 

17. What is the purpose of the USER_ERRORS view?

 

a. It prevents you from having to make use of the SHO ERR command.

 

b. It has the details on database objects in an invalid state.

 

c. It is a record of all compilation errors you have ever made.

 

d. It has no purpose but to take up database space.

 

ans. B

 

 

18. The DESC command behaves like an overloaded procedure.

 

a. True

 

b. False

 

ans. A

 

 

19. All functions require a pragma restriction to be used in an SQL statement.

 

a. True

 

b. False

 

ans. B

 

 

20. A trigger can fire for which of the following?

 

a. Before a triggering event

 

b. After a triggering event

 

c. Before or after a triggering event

 

ans. C

 

 

 


Recommended For You

 

Top 7 advantage of using andriod 5.1 lollipop.

 

Read more

Mozilla firefox 64-bit developer edition launched for windows

 

Read more.

VLC 2.2 launched for windows, mac, linux.

Read more.

Top 10 Keyboard Shortcuts You should Know

Read more.

Popular Open Source IDES For Web Development

Read more.

Asus has launched PB278Q led-backlit monitor in india

Read more.

Sony launches Cyber-shot

 

Read more.