Quantcast
Channel: SCN: Message List - Software Support and Maintenance
Viewing all articles
Browse latest Browse all 2823

.BAT file taking input parameter, invoquing ISQL and passing parameter to SQL Batch Question

$
0
0

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


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>