SQL 14
SQL 14
Declaration:
identifier datatype [NOT NULL] [:=
plsql_expression] ;
Examples:
bonus NUMBER (11,2); in_stock
BOOLEAN; total NUMBER
(7, 2) := 0.0;
birthday DATE := ‘09-OCT-1945’;
name CHAR (20);
Assigning Values To Variables
• Example:
title book_info.book_title%type;
• Advantages:
– Don’t need to know BOOK_TITLE type
– If type changes, no problem
Declarations Using Rows