PL/SQL Function

Oracle PL/SQL function is a subroutine available to applications that access an Oracle database. Functions provide modularity and code reusability. A PL/SQL function is a block of PL/SQL code that can be called by another block of code or from a SQL statement. It returns a single value, which can be a scalar value or…(Continue Reading)

PL/SQL %ROWTYPE Attribute

Oracle PL/SQL %ROWTYPE is a very useful attribute that can be used to fetch rows from a table and store the information in a record. This is especially helpful when you need to loop through a result set and process each row individually. The PL/SQL %ROWTYPE attribute provides a record type that represents a row…(Continue Reading)

PL/SQL %TYPE Attribute

Oracle PL/SQL provides a special data type called the %TYPE data type. The %TYPE data type allows you to declare a variable that is associated with a column in a database table. The %TYPE attribute is a powerful feature designed to enhance the readability, maintainability, and flexibility of code by associating variables with database columns…(Continue Reading)

PL/SQL Variables

What is a variable? A PL/SQL variable is a placeholder for a value. This value can be a number, date, or text string. You can use variables in your Oracle PL/SQL programs to store values temporarily. Syntax To create a variable, you use the following syntax: variable_name datatype [NOT NULL] [:= | DEFAULT initial_value]; You…(Continue Reading)

PL/SQL Anonymous block

An PL/SQL anonymous block consists of a sequence of instructions, the block will be executed only once. The PL/SQL anonymous block is not normally stored in the database for reuse later. Syntax DECLARE — Declarative part (optional) — Declarations of local types, variables, subprograms BEGIN — Executable part (required) — SQL statements — PL/SQL statements…(Continue Reading)