Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

help with isql

5 posts in Windows NT Last posting was on 2000-06-29 11:52:53.0Z
Simon Goldburt Posted on 2000-05-30 20:23:24.0Z
Message-ID: <3934233C.97FC508@ny.frb.org>
Date: Tue, 30 May 2000 16:23:24 -0400
From: Simon Goldburt <simon.goldburt@ny.frb.org>
X-Mailer: Mozilla 4.08 [en] (WinNT; U)
MIME-Version: 1.0
Subject: help with isql
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 8
NNTP-Posting-Host: p1fed3.frb.org 151.198.183.196
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:2082
Article PK: 1089962

I am new to Sybase. I need to create a DOS script. I will start a bat
file, execute a command line like

isql -U%1 -P%2 -S%1 -itest.sql

I know how to pass parameters for a user id, password and a server. I do
not know how to pass a parameter to test.sql.

Please help.


sverre tvedt Posted on 2000-06-29 11:52:53.0Z
From: "sverre tvedt" <a@b>
References: <3934233C.97FC508@ny.frb.org>
Subject: Re: help with isql
Date: Thu, 29 Jun 2000 13:52:53 +0200
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Message-ID: <wXLtlGc4$GA.110@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.nt
NNTP-Posting-Host: ti01a72-0005.dialup.online.no 130.67.39.5
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1959
Article PK: 1089368


Simon Goldburt <simon.goldburt@ny.frb.org> wrote in message
news:3934233C.97FC508@ny.frb.org...
> I am new to Sybase. I need to create a DOS script. I will start a bat
> file, execute a command line like
>
> isql -U%1 -P%2 -S%1 -itest.sql
>
> I know how to pass parameters for a user id, password and a server. I do
> not know how to pass a parameter to test.sql.
>
> Please help.
>

If the content of 'test.sql' is limited, you can circumvent the problem like
this:

<start of DOS script>

echo select %3 from Mytable > test.sql
echo go >> test.sql
rem ... now you have created the test.sql from within the DOS script.
Execute it :
isql -U%1 -P%2 -S%1 -itest.sql
rem --- end of DOS script


I use this method extensively, and it is possible to refine it considerably,
depending on the purpose. Often
the purpose is to insert a 'use Mybase go' in the beginning of a large
script:

echo use Mybase > test.sql
echo go >> test.sql
copy test.sql+largescript.sql test.sql
isql -U%1 -P%2 -S%1 -itest.sql
del test.sql

and so on

;-) sverre


Jason Froebe Posted on 2000-05-30 20:28:16.0Z
Message-ID: <39342460.CB590FE7@sybase.com>
Date: Tue, 30 May 2000 15:28:16 -0500
From: Jason Froebe <jfroebe@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.15 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Simon Goldburt <simon.goldburt@ny.frb.org>
Subject: Re: help with isql
References: <3934233C.97FC508@ny.frb.org>
Content-Type: multipart/mixed; boundary="------------EEF73893F6D0030FB7DA97EC"
Newsgroups: sybase.public.sqlserver.nt
Lines: 31
NNTP-Posting-Host: jfroebe-desktop.sybase.com 157.133.46.52
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:2081
Article PK: 1089555


Simon Goldburt wrote:

> I am new to Sybase. I need to create a DOS script. I will start a bat
> file, execute a command line like
>
> isql -U%1 -P%2 -S%1 -itest.sql
>
> I know how to pass parameters for a user id, password and a server. I do
> not know how to pass a parameter to test.sql.
>
> Please help.

Hi Simon,

You can't as far as I know with dos batch files. You will need to use one
of the bourne/korn/c shells. This can be had from MKS if I remember right.

Jason


Download VCard jfroebe.vcf


David Owen Posted on 2000-05-31 03:44:19.0Z
Sender: dowen@kashka.midsomer.org
Subject: Re: help with isql
References: <3934233C.97FC508@ny.frb.org> <39342460.CB590FE7@sybase.com>
From: David Owen <dowen@midsomer.org>
Organization: Midsomer Consultants Inc.
Date: 30 May 2000 21:44:19 -0600
Message-ID: <m2bt1ne63w.fsf@kashka.midsomer.org>
Lines: 31
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Newsgroups: sybase.public.sqlserver.nt
NNTP-Posting-Host: h29-5d-f4-26324826.cg.shawcable.net 24.70.23.180
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:2075
Article PK: 1089547

>>>>> "Jason" == Jason Froebe <jfroebe@sybase.com> writes:

Jason> Simon Goldburt wrote:

>> I am new to Sybase. I need to create a DOS script. I will start a
>> bat file, execute a command line like
>>
>> isql -U%1 -P%2 -S%1 -itest.sql
>>
>> I know how to pass parameters for a user id, password and a
>> server. I do not know how to pass a parameter to test.sql.
>>
>> Please help.

Jason> You can't as far as I know with dos batch files. You will need
Jason> to use one of the bourne/korn/c shells. This can be had from
Jason> MKS if I remember right.

Another alternative would be to use perl. You don't have to go as far as
Sybperl, but you can use "here" docs within a Perl script that will allow
variable substition. There are other alternatives to MKS kshell (to be
honest I use the MKS kshell all day and cannot understand how any NT admin
worth his salt can work without it) that are free, but they are definitely
heavier users of CPU/resources. I have also done this using edlin (I was
desparate!) using place holders, but it is gross.

dowen


--
David Owen Midsomer Consultants Inc. dowen@midsomer.org
Maintainer of the Sybase FAQ: http://www.isug.com/Sybase_FAQ


Jason Froebe Posted on 2000-05-31 13:39:52.0Z
Message-ID: <39351628.4DB125BB@sybase.com>
Date: Wed, 31 May 2000 08:39:52 -0500
From: Jason Froebe <jfroebe@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.15 i686)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: help with isql
References: <3934233C.97FC508@ny.frb.org> <39342460.CB590FE7@sybase.com> <m2bt1ne63w.fsf@kashka.midsomer.org>
Content-Type: multipart/mixed; boundary="------------5965A85740DF377AEA5518CE"
Newsgroups: sybase.public.sqlserver.nt
Lines: 56
NNTP-Posting-Host: jfroebe-desktop.sybase.com 157.133.46.52
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:2071
Article PK: 1089548


David Owen wrote:

> >>>>> "Jason" == Jason Froebe <jfroebe@sybase.com> writes:
>
> Jason> Simon Goldburt wrote:
> >> I am new to Sybase. I need to create a DOS script. I will start a
> >> bat file, execute a command line like
> >>
> >> isql -U%1 -P%2 -S%1 -itest.sql
> >>
> >> I know how to pass parameters for a user id, password and a
> >> server. I do not know how to pass a parameter to test.sql.
> >>
> >> Please help.
>
> Jason> You can't as far as I know with dos batch files. You will need
> Jason> to use one of the bourne/korn/c shells. This can be had from
> Jason> MKS if I remember right.
>
> Another alternative would be to use perl. You don't have to go as far as
> Sybperl, but you can use "here" docs within a Perl script that will allow
> variable substition. There are other alternatives to MKS kshell (to be
> honest I use the MKS kshell all day and cannot understand how any NT admin
> worth his salt can work without it) that are free, but they are definitely
> heavier users of CPU/resources. I have also done this using edlin (I was
> desparate!) using place holders, but it is gross.
>
> dowen
>
> --
> David Owen Midsomer Consultants Inc. dowen@midsomer.org
> Maintainer of the Sybase FAQ: http://www.isug.com/Sybase_FAQ

Hi David,

I completely forgot about SybPerl. Not enough caffeine! 'Please sir, may
have some more [caffeine]?'

Thanks for reminding us!

j


Download VCard jfroebe.vcf