/* @ C:\web_511\sql\end_conv\oracle\clientes\tek\0001_FUNTEKO_GET_EXPR_TRAD.SQL */

CREATE OR REPLACE FUNCTION GET_EXPR_TRAD
   (P_DSTABELA TABELA.NMTABELABD%TYPE,
    P_DSCOLUNA COLUNA.NMCOLUNA%TYPE,
    P_EXPRPORT PROPRIED.STVALORPROP%TYPE,
    P_IDIDIOMA TRADIDIOMA.IDIDIOMA%TYPE,
    P_CHAVE PROPRIED.NMCOMPONENTE%TYPE)
RETURN PROPRIED.STVALORPROP%TYPE

AS
   V_EXPRTRAD PROPRIED.STVALORPROP%TYPE;

BEGIN

   BEGIN 
      SELECT STVALORPROP
        INTO V_EXPRTRAD
        FROM PROPRIED
       WHERE IDIDIOMA = P_IDIDIOMA
         AND NMFORMULARIO = 'PRODUCAOPRODUCAO_TECNISA'
         AND CDPROGTRAD = P_DSTABELA 
         AND NMPROPRIED = P_DSCOLUNA 
         AND NMCOMPONENTE = P_CHAVE;
   EXCEPTION
      WHEN NO_DATA_FOUND THEN
         V_EXPRTRAD := P_EXPRPORT;
   END;

   RETURN (V_EXPRTRAD);
END;
/

-- VERSAO --
BEGIN ATUVEROBJ('GET_EXPR_TRAD','5.11.XXX'); END;
/
