Multiple choice technology mainframe

How to use host variables in DB2 queries while they accessed through cobol programs.

  1. A. A colon (:) must precede all host variables in an SQL statement

  2. B. A semi colon (;) must precede all host variables in an SQL statement

  3. C. We can use any variable directly

  4. D. None

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

When accessing DB2 database tables from a COBOL program, any host variable referenced inside an EXEC SQL block must be prefixed with a colon (:) to distinguish it from DB2 table column names. Using semicolons or omitting the prefix entirely will cause compilation errors.