Each PL/SQL program consists of SQL and PL/SQL statements which form a PL/SQL block.
A PL/SQL Block consists of three sections: Declaration Section: This section is optional and it starts with the reserved keyword DECLARE.
PL/SQL can only use SELECT, DML(INSERT, UPDATE, DELETE) and TC(COMMIT, ROLLBACK, SAVEPOINT) statements, DDL (CREATE, ALTER, DROP) and DCL(GRANT, REVOKE) cannot be used directly.
Any DDL/DCL however, can be executed from PL/SQL when embedded in an EXECUTE IMMEDIATE statement.
Summary: in this tutorial, we will show you how to use PL/pg SQL Cursor and give you some practical examples of using cursors.