Reference Requirements
These syntax requirements apply when you refer to a host variable in an embedded SQL statement:
Note: You can use the optional keyword INDICATOR as a separator.
Reference Example
In the following example, information from the BENEFITS table is selected for a given employee ID value, which the program has assigned to the host variable EMP-ID. BENEFITS table information is retrieved into host variables VAC-TAKEN and SICK-TAKEN. VAC-TAKEN-I and SICK-TAKEN-I are indicator variables.
EXEC SQL SELECT VAC_TAKEN, SICK_TAKEN INTO :VAC-TAKEN INDICATOR :VAC-TAKEN-I, :SICK-TAKEN INDICATOR :SICK-TAKEN-I FROM BENEFITS WHERE EMP_ID = :EMP-ID END-EXEC.
Copyright © 2013 CA.
All rights reserved.
|
|