Solved

Create Procedure - Server Message:  Number  102, Severity  15

Posted on 2013-10-25
2
738 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
 

Author Closing Comment

by:Michael3232
ID: 39601248
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SYBASE Query combine date spans 7 674
SyBase SQL Query Syntax 11 468
Quickbooks Database Server Manager services crashes when file is opened 15 3,620
Sybase conversion 2 69
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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