How to declare TSQL variable over JDBC connection?
I'm trying to use the standard TSQL DECLARE syntax but I get the following error:
[%msg: < IDENTIFIER expected, @ found^ DECLARE @>]
How do I declare a variable? For instance:
DECLARE @numrecords int = 10;
SELECT TOP @numrecords FROM mytable;
SELECT TOP @numrecords FROM mytable;
We can use TSQL from Caché side, with changing dialect to MSSQL, and this statement will work. But not sure how it would be possible with JDBC.
Why is it different? This is very inconvenient :(
JDBC doesn't have any directives in this case, but I think if you ask InterSystems via WRC, about this feature, they may add it in new versions.