Solved

Create Procedure - Server Message:  Number  102, Severity  15

Posted on 2013-10-25
2
726 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
Comment Utility
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
Comment Utility
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now