Solved

Issue with isql for Sybase

Posted on 2006-11-02
2
867 Views
Last Modified: 2012-05-05
I am facing a problem with isql. There are some scripts(Windows NT) which use isql for both SQL Server and Sybase.

I am trying to execute a query directly when isql is started

In the case of isql with SQL Server

isql -Usa -Paaa -Sabc -Q "Select * from employee"

Its working fine...I am trying to do the same with Sybase..isql for sybase doesn't have any option to. I have seen a  solution for Unix(Using redirection)..but not for Windows...Any ideas?

Also is there a solution other than using -i <input file> option
0
Comment
Question by:karthik_cs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
grant300 earned 500 total points
ID: 17861099
You are very limited with the batch scripting language in windows compared with Linux/Unix.

If you want to maintin one script to handle both O/S, you are going to have to restructure it to use the -i qualifier.

Do something like....

echo "Select * from employee" > scrap.sql
isql -Usa -Paaa -Sabc -i scrap.sql
delete scrap.sql


You may have to alias "delete" for "rm" in the Unix world to keep the sripts identical.

Regards,
Bill
0
 
LVL 24

Expert Comment

by:Joe Woodhouse
ID: 17865242
Bill's pretty much covered this already - you don't have a single option that works in Windows as well... but you can fake it in Windows. There are a number of free UNIX shell utilities for the Windows well, like Cygwin, that would let you use UNIX-style scripts and redirection in all your environments.
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

688 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