Implementing Scalar Function with COALESCE in TX Hi TX Support,
I wanna know how to implementing scalar function with COALESCE in TX ? Here i attach the function, could you please tell me how to do that ?
USE [QAD_DATA]GO/****** Object: UserDefinedFunction [dbo].[GetAliasesByWo1] Script Date: 03/20/2018 16:15:04 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER FUNCTION [dbo].[GetAliasesByWo1]( @item nvarchar(max), @length float, @catego nvarchar(max), @opt nvarchar(max))RETURNS varchar(max)ASBEGIN declare @output varchar(max) select @output = COALESCE(@output + ', ', '') + wo_lot + '=' + convert(nvarchar, wo_qty_ord) FROM wo_mstr_data where wo_part = @item and wo__dec01 = @length and wo__chr01 = @catego and RIGHT(wo_rmks,1) = @opt and wo_status = 'R' and SUBSTRING(wo_routing,1,6) = 'REWORK'
return @outputEND