|
-
Jan 26th, 2007, 04:44 AM
#1
Thread Starter
Frenzied Member
[Resolved] SQL2k Scope Problem
Morning, all. Got this problem and can't figure it out - must be missing something extremely simple. Here's the code:
VB Code:
create function IncAlpha
-- Increments a single alpha character
-- uses this sequence ABCDEF..Z
(@Alpha char(1))
returns char(1)
as
begin
declare @RetVal char(1)
if @Alpha is null or @Alpha=''
set @RetVal='A'
else
set @Retval= char(ascii(@Alpha)+1)
return @Retval
end
go
When I try to compile the function it raises an error on the 'return @Retval' line saying that I must declare it:
VB Code:
Server: Msg 137, Level 15, State 1, Procedure IncAlpha, Line 17
Must declare the variable '@Retval'.
What exactly am I doing wrong, here?
Last edited by yrwyddfa; Jan 26th, 2007 at 04:56 AM.
"As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein
It's turtles! And it's all the way down
-
Jan 26th, 2007, 04:53 AM
#2
Re: SQL2k Scope Problem
Is is case sensitive RetVal / Retval ?
-
Jan 26th, 2007, 04:55 AM
#3
Thread Starter
Frenzied Member
Re: SQL2k Scope Problem
Yes it was - many thanks for helping me, aka the village idiot. Now I'll just have to rebuild the server and take the binary collation off. Don't trust them techie guys, chaps.
Don't trust 'em: Do it yourself.
Many thanks again. Cheers
"As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein
It's turtles! And it's all the way down
-
Jan 26th, 2007, 08:10 AM
#4
Re: [Resolved] SQL2k Scope Problem
I have never used a server that was case-sensitive - what a nightmare that must be!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|