Interview :: PL/SQL
It returns the Boolean value TRUE if at least one row was processed.
It returns the Boolean value TRUE if no rows were processed.
A PL/SQL package can be specified as a file that groups functions, cursors, stored procedures, and variables in one place.
PL/SQL packages have the following two parts:
Specification part: It specifies the part where the interface to the application is defined.
Body part: This part specifies where the implementation of the specification is defined.
The DROP PACKAGE command is used to delete a package.
There are two way to execute a stored procedure.
From the SQL prompt, write EXECUTE or EXEC followed by procedure_name.
Simply use the procedure name
Modularity, extensibility, reusability, Maintainability and one time compilation.
%ISOPEN: it checks whether the cursor is open or not.
%ROWCOUNT: returns the number of rows affected by DML operations: INSERT,DELETE,UPDATE,SELECT.
%FOUND: it checks whether cursor has fetched any row. If yes - TRUE.
%NOTFOUND: it checks whether cursor has fetched any row. If no - TRUE.
A syntax error can be easily detected by a PL/SQL compiler. For example: incorrect spelling etc. while, a runtime error is handled with the help of exception-handling section in a PL/SQL block. For example: SELECT INTO statement, which does not return any rows.
Following conditions are true for the Commit statement:
- Other users can see the data changes made by the transaction.
- The locks acquired by the transaction are released.
- The work done by the transaction becomes permanent.