PL/SQL Variables

The General Syntax to declare a variable is:

variable_name datatype [NOT NULL := value ];
  • variable_name is the name of the variable.
  • datatype is a valid PL/SQL datatype.
  • NOT NULL is an optional specification. When a variable is specified as NOT NULL, you must initialize the variable.
  • Each variable declaration must be terminated by a semicolon.

For example:
DECLARE
salary number(4);
dept varchar2(10) NOT NULL := “HR Dept”;

 

References :

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.