NO it is not possible: In IRIS for Windows (x86-64) 2020.1 (Build 215U) it is compiled. But at run time you get an SQLCODE=1 and an error message for a bad SQL statement. Better compose an SQL string "SELECT name FROM "_table and process it with some ResultSet class,
The embedded code in the class we know from Cache is gone. It all generates into a %scqlc.* class
For more about where the source code for embedded SQL has gone in 2020.1, please see this article on the Universal Query Cache
Indeed funny the doc doesn't call out table names while it does talk about field names, probably because it silently assumes the one implies the other. I'll ask our doc writer to fix that. Thanks for the notification.
I only mentioned the UQC to clarify where source code for embedded SQL went. The use of host variables for table/field names has been addressed in the docs since.
NO it is not possible:
In IRIS for Windows (x86-64) 2020.1 (Build 215U) it is compiled.
But at run time you get an SQLCODE=1 and an error message for a bad SQL statement.
Better compose an SQL string "SELECT name FROM "_table and process it with some ResultSet class,
The embedded code in the class we know from Cache is gone.
It all generates into a %scqlc.* class
But take care you don't open your system up to an SQL Injection attack.
Extending the reply of @Robert Cemper
Everything is fine in Caché: the error occurs at the compilation-time.
In order for an error to occur in IRIS Studio too you need to use the flag /compileembedded=1
For more about where the source code for embedded SQL has gone in 2020.1, please see this article on the Universal Query Cache
Indeed funny the doc doesn't call out table names while it does talk about field names, probably because it silently assumes the one implies the other. I'll ask our doc writer to fix that. Thanks for the notification.
Thanks, @Benjamin De Boe ! It doesn't explain though (at least for me) why hosted variables can't be used for table and column names.
I only mentioned the UQC to clarify where source code for embedded SQL went. The use of host variables for table/field names has been addressed in the docs since.
Use %SQL.Statement for dynamic sql, do not use %ResultSet anymore (it is slower).
Social networks
InterSystems resources
To leave a comment or answer to post please log in
Please log in
To leave a post please log in