SQL/MX 3.2.1 Programming Manual for C and COBOL (H06.26+, J06.15+)

Simple and Compound Statements
HP NonStop SQL/MX Release 3.2.1 Programming Manual for C and COBOL663854-005
5-19
Using PROTOTYPE Host Variables as Table Names
ACCEPT hv-this-jobcode.
...
EXEC SQL
SELECT jobcode, jobdesc
INTO :hv-jobcode, :hv-jobdesc
FROM :hv-tablename PROTOTYPE 'samdbcat.persnl.job'
WHERE jobcode = :hv-this-jobcode END-EXEC.
The columns that you select from a dynamically specified table must be the same as
the columns in the table specified in the PROTOTYPE clause during static compilation.
Otherwise, NonStop SQL/MX returns an error.