'How to use scalar function for searching by string?
CREATE FUNCTION Overruling_function1 (@Stringinput varchar(100))
RETURNS varchar(100)
as
BEGIN
DECLARE @StringOutput varchar(100);
SET @StringInput = OverrulingMotivation
SET @StringOutput =
SELECT CASE
WHEN OverrulingMotivation LIKE '%expected/planned%' then 'expected / planned substantial growth of the financial debt'
ELSE 'other'
END
RETURN (@StringOutput);
END
GO
Can anyone tell me please how to edit my code, when I want to use column(OverrulingMotivation) of existed table in body of function or just how to make it work?
For better understanding, function should search by strings, so input should be some string. Output of function should be name of category as you can see in example above.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
