Link to home
Start Free TrialLog in
Avatar of Michael3232
Michael3232Flag for United States of America

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'.


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

Open in new window


Thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of Michael3232
Michael3232
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michael3232

ASKER