From 3ba2fb4ad3a23d9ea1b17839d819253177e6deea Mon Sep 17 00:00:00 2001 From: Jure Kajzer Date: Mon, 26 Oct 2009 16:23:46 +0000 Subject: [PATCH] Oracle support: added a DB piped function & collection type for getting of DBMS_OUTPUT data trough a standard Oracle SQL query --- maintenance/ora/tables.sql | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/maintenance/ora/tables.sql b/maintenance/ora/tables.sql index f7dcad3c06..1e0289356f 100644 --- a/maintenance/ora/tables.sql +++ b/maintenance/ora/tables.sql @@ -658,3 +658,25 @@ BEGIN END; /*$mw$*/ +/*$mw$*/ +CREATE OR REPLACE TYPE GET_OUTPUT_TYPE AS TABLE OF VARCHAR2(255); +/*$mw$*/ + +/*$mw$*/ +CREATE OR REPLACE FUNCTION GET_OUTPUT_LINES RETURN GET_OUTPUT_TYPE PIPELINED AS + v_line VARCHAR2(255); + v_status INTEGER := 0; +BEGIN + DBMS_OUTPUT.disable; + LOOP + DBMS_OUTPUT.GET_LINE(v_line, v_status); + IF (v_status = 0) THEN RETURN; END IF; + PIPE ROW (v_line); + END LOOP; + RETURN; +EXCEPTION + WHEN OTHERS THEN + RETURN; +END; +/*$mw$*/ + -- 2.20.1