Batch to Run Sybase Script

Hello ,

i have this batch file to generator report , as below code i do .

every time i want to set date FROM , TO , That should i edit batch.sql file to change date manually

now i need one batch to run this batch by set date from to without edit .sql file any more

Regards
Batch : 
 
isql -U -P -S -ic:\Batches\batch_statistics.sql -oc:\batch_statistics.err
 
.SQL file :
 
use test
go
exec test..batch_statistics "formdate","todate"
go
 
From and To Dates should be like this : "20090507" , YYYYMMDD

Open in new window

palservAsked:
Who is Participating?
 
QlemoConnect With a Mentor Batchelor, Developer and EE Topic AdvisorCommented:
To start with, see the code below. How do you want to edit the dates? Provide them when the batch is run, so you are asked for it? Or using actual date? The code shown asks for both dates.


@echo off
set /P fromdate=From Date: 
set /P todate=To Date: 
(echo use test
 echo go
 echo exec test..batch_statistics "%fromdate%","%todate%"
 echo go
) | isql -U -P -S -oc:\batch_statistics.err

Open in new window

0
 
palservAuthor Commented:
Hello,

i cant connect to server ,  maybe should we put isql first??
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
If your isql line works, mine should, too.
0
 
grant300Commented:
You have to put values in for -U (user id) -P (password), and -S (server).

Just use ISQL from the command line until you get the login stuff correct.

Regards,
Bill
0
 
palservAuthor Commented:
Thanks Alot for your helping

Regards
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.