?
Solved

Batch to Run Sybase Script

Posted on 2009-05-06
5
Medium Priority
?
1,569 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 71

Accepted Solution

by:
Qlemo earned 2000 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 71

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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

850 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