I would not recommend ever changing any of the SQL_nnnnn fields - they are for SQL internal use only, and you don't know how they are used by SQL.
I'm looking forward to hear more about the resolution of this problem. Please report back here any development, good or bad, in the case. :-)
Original Message:
Sent: Fri February 09, 2024 09:25 AM
From: Daniel Gross
Subject: SQLCODE -311 with VARCHAR and BOOLEAN in WHERE clause (since 7.5)
Thanks Christian.
We already testet this in every thinkable configuration, but always the same problem.
Strange thing is - if you clear the generated field "SQL_00004" before executing the SQL in the procedure, everything works find. But "SQL_00004" is only a buffer in the generated unnamed static data structure - no host-variable.
Also strange is - it works outside of a procedure (in the cycle main procedure) without problems. But in this case, the generated data structure is not marked as "STATIC" - which might be the problem, but we can't do very much about that.
Long story short - we're already in the process of sending this defect to IBM ...
Our admin team is applying latest PTFs today - but after your tests, I have no high-hopes that this will help.
Anyway - thanks for your effort.
Kind regards,
Daniel
------------------------------
Daniel Gross
------------------------------
Original Message:
Sent: Fri February 09, 2024 04:39 AM
From: Christian Jorgensen
Subject: SQLCODE -311 with VARCHAR and BOOLEAN in WHERE clause (since 7.5)
Hi Daniel,
I tested your program on my IBM i 7.5 system with all latest PTF groups installed, and I get the same error!
When I recreate your program in a SQL compound statement, it runs without errors:
begin declare sVar varchar( 100 ) default 'Hello'; declare bBool boolean default true; declare nCount integer default 0; select count(*) into nCount from sysibm.sysdummy1 where ' ' = sVar and bBool; call SYSTOOLS.LPRINTF( 'nCount = ' concat nCount );end
The above code writes a joblog entry with the text 'nCount = 0' - as expected.
This is an error in the SQL precompiler or runtime, as I see it, and you should report this to IBM.
Best regards,
Christian
------------------------------
Christian Jorgensen
IT System Administrator
Network of Music Partners A/S