I'm trying to execute a fetch into DS on a SQL statement and keep getting code 30: Number of host variables less than result values.
The DS and SELECT statement both have the same number of values as far as I can see.
exec sql declare ClaimRec cursor for
select zclco, zcmco, zcclyr, zcclcd, zcdesc,
coalesce(dbcno, 'NA') as insured, coalesce(dbinnm, 'NA') as name,
coalesce(dbbrk, 'NA') as broker, coalesce(dbagt, 'NA') as agent,
coalesce(dbpsym, 'NA') as symbol, coalesce(dbpno, 'NA') as policy,
coalesce(dbpmod, 'NA') as pmod, coalesce(dbcols, 'NA') as cols,
coalesce(dbrsst, 'NA') as rst, coalesce(dbocdt, 0) as ocdt,
coalesce(dbrpdt, 0) as rpdt, coalesce(dbclsd, 0) as clsd,
coalesce(dbstat, 'NA') as status, coalesce(xcdesc, 'NA') as statdesc
I count 19 for both.
Most of the fields described in the DS are defined in an external PF. Could that be why?
I thought it was because of NULL indicators, so I coalesced everything that can be null.