Hello,
I have created a SQl function that pulls up the concatenated text from the select query. The query has coalesce function embeded in it. The function always returns NULL when executed, though data is present. Help needed.
Function code:
==========
ALTER function [dbo].[GetEloquaColumn]
(@Code_String varchar(200)) returns varchar(300)
as
begin
declare @code varchar(200)
set @code =replace(@Code_String,',',''',''')
set @code=''''+@code+''''
DECLARE @CodeList varchar(250)
SELECT @CodeList=COALESCE(@CodeList+',','') + rtrim(ELOQUA_field_reference)
FROM sysdba.Slx_Eloqua_Code_Reference WHERE slx_pat_codes in (@code)
RETURN @CodeList
end