Michael3232
asked on
Create Procedure - Server Message: Number 102, Severity 15
Adaptive Server Enterprise/11.5.1
I am trying to complete a Stored Procedure for a client that is using a very old version of ASE, no chance of upgrade at this time.
During the Create process I am getting; Server Message: Number 102, Severity 15 on the below code. Both errors point to a 'Set' command. It works in SQL2008, but I need a SYBASE solution.
Server Message: Number 102, Severity 15
Procedure 'getConsumerID', Line 14:
Incorrect syntax near '@ConsumerID'.
Server Message: Number 102, Severity 15
Procedure 'getConsumerID', Line 23:
Incorrect syntax near '@outvar'.
Thanks in advance
I am trying to complete a Stored Procedure for a client that is using a very old version of ASE, no chance of upgrade at this time.
During the Create process I am getting; Server Message: Number 102, Severity 15 on the below code. Both errors point to a 'Set' command. It works in SQL2008, but I need a SYBASE solution.
Server Message: Number 102, Severity 15
Procedure 'getConsumerID', Line 14:
Incorrect syntax near '@ConsumerID'.
Server Message: Number 102, Severity 15
Procedure 'getConsumerID', Line 23:
Incorrect syntax near '@outvar'.
create procedure
getConsumerID @outvar char(9) OUTPUT
as
declare @ConsumerID int
begin transaction
select @ConsumerID = fnPartID
from tblParticipantNo
if @ConsumerID is null
begin
set @ConsumerID = 1
insert into tblParticipantNo values(@ConsumerID)
end
else
begin
update tblParticipantNo set fnPartID=@ConsumerID + 1
end
Select @ConsumerID
set @outvar=@ConsumerID
commit transaction
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER