SQL for Reality > SQL Stored Procedures > DECLARE Statement

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

DECLARE Statement (SQL) (m691509+declare.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

DECLARE Statement

Declares one or more local variables for use in a procedure.

Syntax

DECLARE varname {AS} datatype {,varname {AS} datatype{...}}

Syntax Elements

variable
The name of the variable. This must obey the same rules as Table and Column names, except that it must start with an @ character.

datatype
Any supported SQL data type.

Comments

Local variables must be declared before they can be used.

Local variables are visible only within the procedure in which they are declared.

Examples

DECLARE @I AS INTEGER
DECLARE @V1 DECIMAL(6,2), @UKN VARCHAR(5)

RealityV15.1 (MoTW) Revision 7Comment on this topic