Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Create Procedure - Server Message:  Number  102, Severity  15

Posted on 2013-10-25
2
Medium Priority
?
774 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
  • 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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In this article, the configuration steps in Zabbix to monitor devices via SNMP will be discussed with some real examples on Cisco Router/Switch, Catalyst Switch, NAS Synology device.
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

824 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