21. 4GL Statement Glossary : Execute Procedure : Passing Parameters
 
Share this page                  
Passing Parameters
You can pass parameters by value or by reference. By default, the execute procedure statement passes parameters to a database procedure by value. To pass a parameter by reference, use the byref() option.
By value
To pass a parameter by value, specify param_name = value. When you pass parameters by value, the database procedure receives a copy of the value. Values can be specified using:
Numeric or string literals
Ingres constants (such as today or user)
Host variables
Arithmetic expressions
The value assigned to a param_name must be compatible in type with the formal parameter represented by param_name. You can specify date data using quoted character string values, and money using character strings or numbers. If the data types are not compatible, Ingres issues an error and does not execute the procedure.
By reference
To pass a parameter by reference, specify the parameter as param_name = byref(:host_variable). When you pass parameters by reference, the database procedure can change the contents of the variable. Any changes made by the database procedure are visible to the calling program.