skip to main content

Embedded SQL : Host Variables : Storing binary data in Host Variables

Storing binary data in Host Variables
After the host variable declaration, the following syntax can be used:
Syntax Rules
1.
2.
Type can be one of the following keywords:
o
o
o
Any other value is treated as a comment and doesn’t have effect
General Rules
1.
Code example
The content of the column t1_field_2 of type RAW in a Oracle table is shown in hex format after reading
exec sql include SQLCA end-exec.
77 wrk-ascii pic x(128).
exec sql var wrk-ascii is raw end-exec.
77 wrk-hex pic x(256).
procedure division.
exec sql
select t1_field_2 into :wrk-ascii from table1 where t1_pk = 1
call "ASCII2HEX" using wrk-ascii, wrk-hex.
display "t1_field_2 = " wrk-hex.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left