This is not a DS question, but I thought someone out there may have an answer. Google is not working well for me today, and Sybase and Microsoft can't seem to get me to the answer.
I need to run a SQL script from a DS job. The script has a few variables in it that need resolution at runtime (from date and to date). Something like:
Code: Select all
TRUNCATE TABLE mytable
INSERT INTO mytable (SELECT thiskey FROM bigtable WHERE loaddate BETWEEN '%fromdate%' AND '%todate%'
COMMIT
GO
QUIT
I want DS to do this, where ISQLstub.ksh is a wrapper script to ISQL command line:
Code: Select all
CommandLine="ISQLstub.ksh -S myserver -U myuser -P mypassword -I myscript ":FromDate:" ":ToDate
Call DSExecute("UNIX", CommandLine, ScreenOutput, ReturnCode)
Outside of enhancing ISQLstub.ksh to parse the SQL script, substituting %fromDate% and %todate%, and writing a temporary SQL script with the substituted values to use instead, does anyone know a way to have ISQL resolve "parameters"? Oracle sqlplus does this using &1, &2, &3, etc, but I could't find where you can do this with ISQL.