I've tried to read up on Sybase but the information that I'm getting is too unclear for me. The issue that I'm having is that I have to edit this 6000 line stored procedure in Sybase. Needless to say it's a complete nightmare, especially for someone who's strongest point isn't exactly SQL.
At the top of the procedure there's a variable declared (just using shorter variable names for the sake of this question):
DECLARE @MY_VARIABLE INT
The little SQL I'm familiar with is SQL Server, and Sybase is feeling quite a bit different. How exactly do you set a value to that variable? In SQL Server I'd image it would be something like this:
SET @MY_VARIABLE = 1
However I can't find any place in the procedure where something like this happens. I did find this though:
SELECT @MY_VARIABLE = convert(integer, Member_Number)
FROM ELECTRONIC_FORM NOHOLDLOCK
Is this how you set a variable in Sybase? With
SELECT @MY_VARIABLE = 2
for example?
Besides that, how do I return the value of the variable at the end of the procedure? I would've imagined it be something like this:
SELECT @MY_VARIABLE
And just make sure it's the last thing in the procedure but that doesn't seem to work. And it's looking quite similar to the way I have a feeling a variable actually gets set and not selected. I'm just really confused and lost here, thanks in advance for any help out there!