The purpose of the program: Given the Country Code, Returns the Countries Region. My only error is my _code variable that I am TRYING to use as a parameter for the Code input(Will not tell me what is, see attached pdf). I used a very similar format when building a procedure, but some other rules must apply in this case.
Attached is a screen shot of the code with the error but as I said it doesn't specify. along with a screen shot of the country, class to see where I got "Code" and "country" from.
Any suggestions how to solve this in order to get the program to compile?
See these images:
CREATE FUNCTION getRegion(@_code varchar(3))
RETURNS varchar(50)
AS
BEGIN
DECLARE @region varchar(40)
SELECT @region = Region
FROM country
WHERE Code = @_code
RETURN @region
END