These variables pass information to Adaptive Server. The application program assigns values to them. They hold data used in executable statements such as stored procedures, select statements with where clauses, insert statements with values clauses, and update statements with set clauses.
The following example uses the TITLE-ID1, TITLE-ID2, and PUB-ID variables as input variables:
exec sql begin declare section end-exec
01 TITLE-ID1 PIC X(6).
01 TITLE-ID2 PIC X(6).
01 PUB-ID PIC X(4).
exec sql end declare section end-exec
exec sql delete from titles
where title_id = :TITLE-ID1 end-exec.
exec sql update titles set pub_id = :PUB-ID
where title_id = :TITLE-ID2 end-exec.