03-02-2018 07:27 PM
I have a number of large SybaseIQ SQL scripts (5000+ lines each). The READ statement for each contains a number of parameters. Is there a way to execute the READ through the Proc SQL procedure using the SAS/ACCESS for SybaseIQ interface?
many thanks in advance
03-02-2018 08:59 PM
Here is how you do an EXECUTE statement. All you need to do is put your Sybase code inside the brackets. Does this produce a result set by the way? If so then you may need to take a different approach.
03-02-2018 09:18 PM
Thanks SAS Kiwi,
Yes it produces a very large result set. Also, inserting the code between braces is not practical because as I mentioned, some of these queries are 5000+ lines long.
03-02-2018 09:26 PM
You could wrap the SQL code into an SQL stored procedure, then call that. You will also need to create a temporary table or view instead of producing a result set and then query the table / view in a following "normal" SQL passthru query.
03-02-2018 09:33 PM
Good idea !! This sounds feasible, I'll give it a go on Monday and let you know how it goes. However I think there is still one potential issue which I forgot to mention earlier. Some of the parameters to the SQL script need to bee macro variables.
03-02-2018 09:39 PM
Shouldn't be a problem. The usual hassle is most databases require parameters to be wrapped in single quotes but this technique gets around that problem: