Re: Facing problem in Executing Stored Procedure for Sybase12.0 On Apr 29, 11:30 am, Mike <apurv.agar...@gmail.com> wrote:
> Dear All,
>
> I am facing a Problem in executing a SP fr Sybase12.0
>
> Use Test1
> go
> create table Data1(ID int,Names varchar(30),Names1 varchar(30),Primary
> key(ID))
> go
>
> create procedure SP_Insert
> AS BEGIN
>
> Declare @Input int ,@Count int
> Set @Input = 100000
> Set @Count = 0
>
> While @Count < @Input
>
> BEGIN
>
> Insert into Data1 Values(@Count,'hello1','hello1')
>
> select @Count = @Count + 1
>
> END
>
> END
>
> Exec SP_Insert
> Go
>
> For this I am getting an error:
>
> Error] Script lines: 6-32 -------------------------
> Incorrect syntax near '@Input'.
> Msg: 102, Level: 15, State: 1
> Procedure: SP_Insert, Line: 9
>
> Can some one help me on this?
>
> ----Mike
In 12.0 you can't use "set" to assign a value to a variable. Replace
set @input = ...
by
select @input = ...
Michael |