/* @ C:\web_545\sql\end_conv\oracle\clientes\tek\0000_FUNTEKO_BKG_DSVALPTHREAD.SQL */

CREATE OR REPLACE FUNCTION GET_BKG_DSVALPTHREAD
   (R rowid) 
RETURN VARCHAR2

IS
   TMP_VARCHAR VARCHAR2(1000);
   TMP_LONGRAW LONG RAW;

   CURSOR C1 IS SELECT DSVALPTHREAD 
                  FROM BKGTHREADPARAM 
                 WHERE ROWID = R;
BEGIN
   OPEN C1;
   LOOP
      FETCH C1 INTO TMP_LONGRAW;
      EXIT WHEN C1%NOTFOUND;
       
      TMP_VARCHAR := UTL_RAW.CAST_TO_VARCHAR2(TMP_LONGRAW);
   END LOOP; 
   
   RETURN (TMP_VARCHAR);
END;
/

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