-- ******************************************************************
-- *
-- * Copyright (c) 2000, 2007, Oracle. All rights reserved.
-- *
-- ******************************************************************
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
IF EXISTS (SELECT name FROM sysobjects 
         WHERE name = 'CIZSAFTS' AND type = 'P')
   DROP PROCEDURE RPTUSER.CIZSAFTS

CREATE PROCEDURE CIZSAFTS
@P_SA_ID CHAR(10)
AS

BEGIN
	SELECT SUM( A.CUR_AMT) CUR_AMT,
	       SUM( A.TOT_AMT) TOT_AMT,
	       A.CURRENCY_CD,
	       B.CUR_SYMBOL,
	       B.DECIMAL_POSITIONS,
	       B.SCALE_POSITIONS,
	       B.CUR_POS_FLG
    	FROM CI_FT A, CI_CURRENCY_CD B
    	WHERE  A.SA_ID = @P_SA_ID
       	       AND A.REDUNDANT_SW = 'N'
       	       AND A.FREEZE_SW = 'Y'
	       AND A.CURRENCY_CD = B.CURRENCY_CD
	GROUP BY A.CURRENCY_CD,
	         B.CUR_SYMBOL,
		 B.DECIMAL_POSITIONS,
		 B.SCALE_POSITIONS,
		 B.CUR_POS_FLG;
RETURN
END

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

