Oracle declare vars Oracle declare vars Oracle declare vars
 

Oracle Function: declare vars

A literal is the same as a constant. We'll cover three types of literals - text literals, integer literals, and number literals

Text literals are always surrounded by single quotes ('). For example:

'Hewlett Packard' '28-MAY-03'

Integer literals can be up to 38 digits. Integer literals can be either positive numbers or negative numbers. If you do not specify a sign, then a positive number is assumed. Here are some examples of valid integer literals:

23 +23 -23

Number literals can be up to 38 digits. Number literals can be either positive or negative numbers. If you do not specify a sign, then a positive number is assumed. Here are some examples of valid number literals:

25 +25 -25 25e-04 25.607

 

 
 

The syntax for declaring variables is:

variable_name datatype [CONSTANT] [NOT NULL] [:= | DEFAULT initial_value]

For example:

Declaring a variable:

LDescription varchar2(40);

Declaring a constant:

LTotal constant numeric(8,1) := 8363934.1;

Declaring a variable with an initial value (not a constant):

LType varchar2(10) := 'Example';

 
 
Oracle pl/sql Oracle pl/sql
 
     
  29-11-2006 Guida Oracle 10g
     
  30-02-2007 Oracle Server
     
  29-02-2007 Oracle Errors
Functions Oracle Functions
Delete Delete
Between Between
Check Check
Count Count
Datatypes Datatypes
Delete Oracle Delete Statement
Distinct Distinct
Exists Exists
Functions Functions
Grant revoke Grant Revoke
Group by Oracle Group by
Having Having
Oracle Function in Oracle Function in
Indexes Indexes
Insert Insert
Intersect Intersect
Isnull Is null
Joins Joins
Substr Substr
instr Oracle instr
blob Oracle blob
roles Oracle roles
Substr Substr
like Oracle like
Substr Oracle minus
Substr Oracle to_number
union Oracle union
query Oracle query
Substr Oracle unique
Substr Oracle union all
Substr Oracle alter table
 
Oracle Functions PLSQL  l Consulenza Software Verona  l  Siti Web Verona  l   Exceptions  l  Oracle Errors  l  Oracle Collaborations Suite  l  Products  l  Contact
Oracle errors ora