I\'ve executed the function already which is why now I\'m getting the red line b
ID: 3732508 • Letter: I
Question
I've executed the function already which is why now I'm getting the red line because it already does exist. But I cannot figure out how to test it by passing things like 'mod_cook', 'business', etc. Through it.
I don't really know how to test to make sure this works. I tried a Select function but I don't think I have the syntax right to get it to work.
Explanation / Answer
** Try this out ::
Create Function fn_SelectFullTitleTypeS_S_m513
( @Type Char(12) ) --list of arguments, has a single argument coming in at typechar
Returns NvarChar(50) --will return as
AS
BEGIN
RETURN ( SELECT CASE @Type
WHEN 'business' THEN 'Business'
WHEN 'mod_cook' THEN 'Modern Cooking'
WHEN 'popular_comp' THEN 'Popular Computing'
WHEN 'psychology' THEN 'Psychology'
WHEN 'trad_cook' THEN 'Traditional Cooking'
WHEN 'UNDECIDED' THEN 'Undecided'
END ) --this end is the end for case
END; --this ends the begin
GO
Select dbo.fn_SelectFullTitleTypeS_S_m513('mod_cook')
** You can execute function using following line
Select dbo.fn_SelectFullTitleTypeS_S_m513('mod_cook')
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.