how to solve this

procedure , sql2000 , function Bekasi, Indonesia
  • 11 years ago

    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 FKStck=@KdStock And FKGdg=@Gudang And FTgl=@TglTrans
    	--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 @Gabung=@NoTrans+'('+@QtyMainCon+')'+'@'+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

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Brevity is the soul of wit” - Shakespeare