Assignment
To assign a value to a variable or row/record field, use the assignment
statement as follows:
identifier := expression; If the expression’s result data type does not match the variable’s data type but the types are compatible, or the variable has a size/precision that is known (as for char(20)), the result value is implicitly cast by the NZPLSQL bytecode interpreter using the result type’s output-function and the variable’s type input-function. Note that this could potentially result in runtime errors generated by the type’s input functions.
Several examples follow:
user_id := 20;
tax := subtotal * 0.06;For more information about casting rules and behaviors, see the IBM® Netezza® Database User’s Guide.