Solved

Issue with isql for Sybase

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 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

18 Experts available now in Live!

Get 1:1 Help Now