SQl function returning NUll though the query used in function pulls up the data.

  • 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

  • Crossposting = bad.

    Discussion about this can be found here as well

    http://www.sqlservercentral.com/Forums/Topic992468-338-1.aspx

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply