Up Prev Next
From: sy50027 at milton dot sbi dot com (Simon Yaminian)
Subject: RE: Use of variables in batch files
Date: Aug 17 1998 2:56PM
> From owner-SYBPERL-L@listproc.net Mon Aug 17 10:37:36 1998
> From: "Cross, David"
> To: SybPerl Discussion List
> Subject: RE: Use of variables in batch files
> Date: Mon, 17 Aug 1998 11:32:50 +0100
> Mime-Version: 1.0
> X-Listprocessor-Version: 8.2.07 -- ListProc(tm) by CREN
> Are you missing the 'go' from the end of your file?
> Dave Cross
> Credit Suisse First Boston
> > ----------
> > From: firstname.lastname@example.org[SMTP:email@example.com]
> > Sent: 14 August 1998 14:35
> > To: SybPerl Discussion List
> > Cc: firstname.lastname@example.org
> > Subject: Use of variables in batch files
> > Hello,
> > Is there anything special you need to consider in using variables (e.g.
> > @var)
> > in the batch files. When I use variables in the batch of commands similar
> > to the
> > following, I get no results.
> > declare @count smallint
> > select @count = 1
> > results:
> > select * from table
> > select @count = @count + 1
> > while @count <= 5
> > goto results
> > Any ideas why?
> > Thanks
> > Simon Yaminian
> Thanks for the reply,
The 'go' statement is not mandatory. In fact the query runs and it even gives
you the showplan but when it gets to the select statement, no results are
generated. When I test the query with only the 'declare' statement for the
@count variable, the select statement yields results. It seems that when the
select statement is used in conjunction with a variable (in this case,
select @count = 1), it throuws off the entire query. Any 'select' statement
for initializing a variable or performing (arithmetic or other) operations with
a variable does not run.
I also tried using '\' with the variable name (e.g. \@count) averting the
possible interpolation of '@' sign by Perl but that did not work either.
There must be a simple answer to this. Don't you think?!!