-- ******************************************************************
-- *
-- * 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 = 'CIZLANG' AND type = 'P')
   DROP PROCEDURE CIZLANG
GO

CREATE PROCEDURE CIZLANG
@P_USER_ID CHAR(8)
AS
/******************************************************************************
   NAME:       CIZLANG
   PURPOSE:    Standard Extract All languages for Crystal Report

******************************************************************************/
BEGIN

  DECLARE   @V_USER_LANG_CD CHAR(3);

  BEGIN

    BEGIN
      SELECT @V_USER_LANG_CD=LANGUAGE_CD
      FROM   SC_USER
      WHERE  SC_USER.USER_ID = @P_USER_ID;

      IF (@@ROWCOUNT=0) 
	    SELECT @V_USER_LANG_CD = 'ENG'
    END

    SELECT   LANGUAGE_CD, @V_USER_LANG_CD  V_USER_LANG_CD
    FROM     CI_LANGUAGE
    ORDER BY LANGUAGE_CD;
  END	

END 



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
