Отвечено udf function not returnint proper value

  • 9 марта 2011 г. 15:11
     
     

    I am trying to create a simple function to return a string value but the problem it returns only 1 char instead of the full work
    [code]
    -- Declare the return variable here
    DECLARE @mois nvarchar(10)
    -- Add the T-SQL statements to compute the return value here

     

    RETURN CASE @inMth
    WHEN 'Jan' THEN 'Janvier'
    WHEN 'Feb' THEN 'Fevrier'
    WHEN 'Mar' THEN 'Mars'
    WHEN 'Apr' THEN 'Avril'
    WHEN 'May' THEN 'Mai'
    WHEN 'Jun' THEN 'Juin'
    WHEN 'Jul' THEN 'Juillet'
    WHEN 'Aug' THEN 'Aout'
    WHEN 'Sep' THEN 'Septembre'
    WHEN 'Oct' THEN 'Octobre'
    WHEN 'Nov' THEN 'Novembre'
    WHEN 'Dec' THEN 'Decembre'
    END

    -- Return the result of the function

     

    RETURN @mois
    [/code]

    when I run the following I get J as the returm value 

    select

     

    @m= dbo.udf_TranslateMonthToFrench('Jan')
    print @m

    Thanks

Все ответы