Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

arguments in isql session

Posted on 1999-07-19
3
Medium Priority
?
1,143 Views
Last Modified: 2011-10-03
I'm setting up a script for isql but I need to pass an argument also:
isql -Uuser -Ppassword < myscript <commandlineargument>
How do I reference this command line argument in my script - $1 or something?
0
Comment
Question by:robjay
[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
3 Comments
 

Accepted Solution

by:
jordan1 earned 200 total points
ID: 1098924
Hi robjay!

       isql would not take arguments like that.

       You can set your variables in the script itself
and then call isql and use the variables inside it.

Example script:
#! /usr/bin/ksh
TABLENAME="usernames"
NAME="John Doe"
isql -Urobjay -SSERVER<<-EOF
   password
   select * from ${TABLENAME}
   where name = "${NAME}"
   go
EOF


   If this is not what you are looking for, let me know.



 
0
 

Author Comment

by:robjay
ID: 1098925
Yes, this works for me. Thanks.
0
 

Author Comment

by:robjay
ID: 1098926
Is there any way to get an argument FROM the isql session to the shell?
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

715 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