Using Assignment Statements

From InterBase

Go Up to The Procedure Body


A procedure can assign values to variables with the syntax:

variable = expression;

where expression is any valid combination of variables, operators, and expressions, and can include user-defined functions (UDFs) and generators.

A colon need not precede the variable name in an assignment statement. For example, the following statement assigns a value of zero to the local variable, ANY_SALES:

any_sales = 0;

Variables should be assigned values of the data type that they are declared to be. Numeric variables should be assigned numeric values, and character variables assigned character values. InterBase provides automatic type conversion. For example, a character variable can be assigned a numeric value, and the numeric value is automatically converted to a string. For more information on type conversion, see the Embedded SQL Guide.

Advance To: