Home Interview Questions and Answers PL/SQL Interview Questions and Answers Part-3

SQL21. Show the two PL/SQL cursor exceptions.
Cursor_Already_Open

Invaid_cursor

22. What operators deal with NULL?
NVL converts NULL to another specified value.

var:=NVL(var2,’Hi’);

IS NULL and IS NOT NULL can be used to check specifically to see whether the value of a variable is NULL or not.

23. Does SQL*Plus also have a PL/SQL Engine?
No, SQL*Plus does not have a PL/SQL Engine embedded in it. Thus, all PL/SQL code is sent directly to database engine. It is much more efficient as each statement is not individually stripped off.

24. What packages are available to PL/SQL developers?
DBMS_ series of packages, such as, DBMS_PIPE, DBMS_DDL, DBMS_LOCK, DBMS_ALERT, DBMS_OUTPUT, DBMS_JOB, DBMS_UTILITY, DBMS_SQL, DBMS_TRANSACTION, UTL_FILE.

25. Explain 3 basic parts of a trigger.
A triggering statement or event.
A restriction
An action

26. What are character functions?
INITCAP, UPPER, SUBSTR, LOWER and LENGTH are all character functions. Group functions give results based on groups of rows, as opposed to individual rows. They are MAX, MIN, AVG, COUNT and SUM.

27. Explain TTITLE and BTITLE.
TTITLE and BTITLE commands that control report headers and footers.

28. Show the cursor attributes of PL/SQL.
%ISOPEN : Checks if the cursor is open or not

%ROWCOUNT : The number of rows that are updated, deleted or fetched.

%FOUND : Checks if the cursor has fetched any row. It is true if rows are fetched

%NOT FOUND : Checks if the cursor has fetched any row. It is True if rows are not fetched.

29. What is an Intersect?
Intersect is the product of two tables and it lists only matching rows.

30. What are sequences?
Sequences are used to generate sequence numbers without an overhead of locking. Its drawback is that the sequence number is lost if the transaction is rolled back.

You may also like

Leave a Comment