Solved

Batch to Run Sybase Script

Posted on 2009-05-06
5
1,203 Views
Last Modified: 2012-05-06
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

0
Comment
Question by:palserv
  • 2
  • 2
5 Comments
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 total points
ID: 24323558
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
 

Author Comment

by:palserv
ID: 24323858
Hello,

i cant connect to server ,  maybe should we put isql first??
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 24324857
If your isql line works, mine should, too.
0
 
LVL 19

Expert Comment

by:grant300
ID: 24327652
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
 

Author Comment

by:palserv
ID: 24347064
Thanks Alot for your helping

Regards
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now