Solved

Issue with isql for Sybase

Posted on 2006-11-02
2
815 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
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A procedure for exporting installed hotfix details of remote computers using powershell
In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

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