The Oracle PL/SQL PLS_INTEGER data type is used to store numeric data. Syntax The syntax for using this data type is as follows: variable_name PLS_INTEGER; Example An example of using this data type is as follows: declare v_num PLS_INTEGER := 10; v_result PLS_INTEGER; begin if v_num = 10 then v_result:=100; end if; DBMS_OUTPUT.PUT_LINE(‘v_result = ‘||v_result);…(Continue Reading)
Category: PL/SQL
Learn PLSQL Tutorial
PL/SQL NUMBER
The Oracle PL/SQL NUMBER data type is used to store numeric values. It can be either an integer or a decimal number. Syntax The syntax for the NUMBER data type is as follows: number number(38) number(10,2) The first form, “number”, stores up to 38 digits. The second form, “number(38)”, stores up to 38 digits with…(Continue Reading)
PL/SQL INT
The PL/SQL INT data type in Oracle database is used to store whole numbers. Syntax The syntax for declaring a variable of type INT is: variable_name INT; Example For example, the following declaration creates a variable called var_int: declare var_int INT; begin var_int := 10; dbms_output.put_line(‘1. var_int = ‘||var_int); var_int := var_int * 2; dbms_output.put_line(‘2.…(Continue Reading)
PL/SQL DATE
The Oracle PL/SQL DATE data type is used to store date and time values. Syntax The syntax for declaring a DATE variable is as follows: variable_name DATE; Examples An example of how to declare a DATE variable, assign a value, and store it in a table is as follows: DECLARE l_date DATE; BEGIN l_date :=…(Continue Reading)
PL/SQL CLOB
The Oracle PL/SQL CLOB or Character Large Object data type is used to store character-based data in a database. This data type is often used to store text, json or xml documents. Syntax The syntax for creating a CLOB column is as follows: CREATE TABLE table_name ( column_name CLOB ); Example An example of using…(Continue Reading)