I Have problem with this the result of this function.
I declared the function return is varchar 8000
but when the function running the, is return result 256 characters only.
When the result more than 256 characters, it's cut the result.
I Call the function from procedure, and it feedback the 256 characters.
how to get complete result?
The procedure similar with:
Select fGetSumBuySellBuy('2009-04-16','BHM','FU20W50080TEC') As NoBukti
the result is:
A008598(1),A008601(1),A008602(1),A008603(1),A008604(1),A008605(1),
A008606(1),A008608(1),A008609(1),A008611(1),A008614(1),A008618(1),
A008626(1),A008633(1),A008637(1),A008638(1),A008639(1),A008641(1),
A008643(1),A008647(1),A008648(1),A008651(1),A008653(1),A00
but the complete data is
A008614(3),A008626(1),A008637(1),A008638(1),A008639(1),
A008598(1),A008601(1),A008603(1),A008604(1),A008605(1),
A008606(1),A008608(1),A008609(1),A008611(1),A008618(1),A008633(1),
A008641(1),A008643(1),A008647(1),A008648(1),A008651(1),
A008653(1),A008654(1),A008657(1),A008658(1),A008662(1),
A008664(1),A008671(1),A008672(1),A008673(1),A008676(1),A008677(1),
A008680(1),A008683(1),A008684(1),A008687(1),A008689(1)
Here the funtion:
ALTER FUNCTION fGetSumBuySellBuy (@TglTrans Datetime,
@Gudang Varchar(30),@KdStock Varchar(30))
RETURNS VarChar (8000)
--WITH ENCRYPTION
AS
BEGIN
DECLARE @NoAwal VarChar(100)
DECLARE @NoAkhir VarChar(2000)
Declare @Gabung Varchar(100)
Declare @NoTrans Varchar(30)
Declare @QtyMain INT
Declare @QtyMainCon Varchar(30)
Declare @HPP Money
SET @NoAwal =''
SET @NoAkhir =''
DECLARE Curs CURSOR
LOCAL FOR
SELECT FNTrans,FQtyMain,dbo.f_Divide(FNominal,FQtyMain) As HPP FROM StckMsk
Where (FTpTr='BELI_R' or FTpTr='TrStckPdh_R') And [email protected] And [email protected] And [email protected]
--Group BY FNTrans,FKStck,FTgl,FKGdg,FSat
OPEN Curs
FETCH NEXT FROM Curs INTO @NoTrans,@QtyMain,@HPP
WHILE @@FETCH_STATUS=0
BEGIN
Set @QtyMainCon=Cast(@QtyMain as Varchar)
Set @[email protected]+'('[email protected]+')'+'@'+Cast(@HPP As Varchar)
IF @NoAkhir =''
BEGIN
SET @NoAkhir = @Gabung
END
ELSE
BEGIN
SET @NoAkhir = @NoAkhir +','+ @Gabung
END
FETCH NEXT FROM Curs INTO @NoTrans,@QtyMain,@HPP
END
RETURN (@NoAkhir)
END
!--removed tag-->
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).