Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Procedure in package hangs sessions
I'm experiencing frequent session hangs when submitting a procedure in a
package that drops a table, creates a table from a dynamic query, then
grants select privilege to PUBLIC. Seems to work fine as a standalone
procedure from SQL*Plus. Any help is greatly appreciated. Procedure code
is:
PROCEDURE dyntable (query_in IN CHAR, ret_value OUT INTEGER)
IS
CURSOR col_cur (query_in IN CHAR) -- collect columns needed for query
IS
SELECT UNIQUE mv.variable_id
FROM siferd.query_matrixes qm,
siferd.matrix_variables mv
WHERE qm.query_id = query_in
AND mv.matrix_id = qm.matrix_id
UNION
SELECT UNIQUE variable_id
FROM siferd.query_variables
WHERE query_id = query_in
;
CURSOR table_cur (query_in IN CHAR) -- collect table names needed for query
IS
SELECT UNIQUE oracle_name
FROM siferd.variable_definitions vd,
siferd.query_matrixes qm
WHERE qm.query_id = query_in
AND SUBSTR(vd.variable_id,1,7) = qm.matrix_id
UNION
SELECT UNIQUE oracle_name
FROM siferd.variable_definitions vd,
siferd.query_variables qv
WHERE qv.query_id = query_in
AND vd.variable_id = qv.variable_id
;
cur INTEGER := DBMS_SQL.OPEN_CURSOR; -- create dynamic SQL cursors
col_list VARCHAR2(5000); -- strings for assembling DDL code
table_list VARCHAR2(2000) := 'query_geographies f0';
join_list VARCHAR2(2000);
table_ind PLS_INTEGER := 0; -- counter for file aliases
BEGIN
drop_object('table','temp_' || query_in); -- proc to drop temp tables in
this schema
FOR col_rec IN col_cur(query_in) LOOP -- loop thru cursor to assemble list
of columns
col_list := col_list || ', ' || 'v' || col_rec.variable_id;
END LOOP;
FOR table_rec IN table_cur(query_in) LOOP -- loop thru cursor to assemble
list of tables
table_ind := table_ind + 1; -- to query and join table_list := table_list || ', ' || table_rec.oracle_name || ' f' || table_ind;
Thanks! Received on Fri Aug 07 1998 - 15:46:42 CDT
![]() |
![]() |