Written by

Senior Software Engineer
Question Ashok Kumar T · May 8, 2025

Embedded SQL result issues inside %ZLANGC routine

Hello Community,

I executed the below query in the %ZLANGC00.mac routine. It returns results when using dynamic SQL, but not with embedded SQL(returns 0). 

 &SQL(SELECTcount(*) INTO :Cnt FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'")
 Write "SQLTablecount : "_Cnt,!
 Set tResultSet = ##class(%SQL.Statement).%ExecDirect(,"SELECTcount(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'")
 Do tResultSet.%Display()

Thanks!

Product version: IRIS 2024.1
$ZV: IRIS for Windows (x86-64) 2024.1.1 (Build 347U) Thu Jul 18 2024 17:40:10 EDT

Comments

Eduard Lebedyuk · May 8, 2025

Can't reproduce in IRIS for Windows (x86-64) 2022.1 (Build 209U) Tue May 31 2022 12:16:40 EDT:

But can reproduce on IRIS for Windows (x86-64) 2025.1 (Build 223U) Tue Mar 11 2025 18:14:42 EDT

Please file a WRC. Looks like something changed between 2022.1 and 2024.1.1

0
David Van De Griek  May 12, 2025 to Ashok Kumar T

This issue was introduced in 2024.1.0.  I corrected it today.  Thank you for reporting it.

0
Ashok Kumar T  May 12, 2025 to David Van De Griek

Thank you for the quick resolution and the update. Glad to hear it's been addressed!

0