[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Issue with isql for Sybase

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

With the evolution of technology, we have finally reached a point where it is possible to have home automation features like having your thermostat turn up and door lock itself when you leave, as well as a complete home security system. This is a st…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

650 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