dcl-proc prTest;
exec sql select count(*)
into :nCount
from sysibm.sysdummy1
where ' ' = :sVar and :bBool ;
return;
end-proc;
When running/debugging the program, the SQLCODE is *ZERO after the first procedure call.
But after the second procedure call, the SQLCODE is -311, which means "Length in varying-length, LOB, or XML host variable not valid".
If I remove either the Boolean or the Varchar variable from the statement, it runs fine. Changing ":bBool" to ":bBool = '1'" or anything else doesn't help.
If I add the line
sql_00004 = *blank;
just before the EXEC SQL it runs also fine. This is the buffer before the VARCHAR field in the SQL host variables DS, that the Pre-Compiler defines. And the content of this "buffer" is the only thing that differs from call 1 to call 2.
But this shouldn't happen? Or should it? What am I doing wrong?
From what I can see, it happens only, if the program was compiled on 7.5. If it was compiled on an earlier release, it seems to run fine on 7.5.
TIA for every hint.
Daniel
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.