Greetings,
It has been a while so I would appreciate some help.
I think I recall that you can code a .BAT file to access ASE via ISQL, submit SQL CODE and take a parameter in from the command line. I am trying it, but I don´t quite remember the syntax. Can somebody spot the mistake?
The command line parameter should be "%1". The error message indicate that "<<" was not expected...
Thank you and regards.
Jean-Pierre
Here´s the .BAT file contents
isql -Usa -Ppassword -SPC1 -e <<EOF
USE test
GO
CREATE TABLE #temp
(
a VARCHAR(255) NULL
)
INSERT INTO #temp
SELECT
CASE
WHEN CHARINDEX("%1", UPPER(SUBSTRING(a,1,30))) = 0 THEN NULL ELSE UPPER(SUBSTRING(a,1,30))
END
FROM test..x
SELECT * FROM #temp WHERE a iS NOT NULL
GO
EOF