Solved

Create Procedure - Server Message:  Number  102, Severity  15

Posted on 2013-10-25
2
748 Views
Last Modified: 2013-10-25
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
0
Comment
Question by:Michael3232
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 

Accepted Solution

by:
Michael3232 earned 0 total points
ID: 39601182
The answer to my problem was SYBASE does not accept SET on return variables.

Select @ConsumerID=1 and Select @outvar=ConsumerID then gave me a new error that I needed to Convert the Int to a Char.

SOLVED!
0
 

Author Closing Comment

by:Michael3232
ID: 39601248
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question