?
Solved

Issue with isql for Sybase

Posted on 2006-11-02
2
Medium Priority
?
873 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 1500 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 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