我不認爲你可以這樣做
CREATE PROCEDURE process_structures
AS
<<other variable declarations>>
rindex BINARY_INTEGER;
slno BINARY_INTEGER;
totalwork NUMBER := y; -- Total number of structures
worksofar NUMBER := 0; -- Number of structures processed
BEGIN
rindex := dbms_application_info.set_session_longops_nohint;
FOR i IN (<<select structures to process>>)
LOOP
worksofar := worksofar + 1;
dbms_application_info.set_session_longops(
rindex => rindex,
slno => slno,
op_name => 'Processing of Molecular Structures',
sofar => worksofar ,
totalwork => totalwork,
target_desc => 'Some description',
units => 'structures');
<<process your structure with your existing code>>
END LOOP;
END;
從一個單獨的SQL * Plus會話,然後你可以的監察進度。據我瞭解dbms_output它只是不這樣工作。
我建議你使用put來回顯每1000條左右的單個點和一個換行符,看看發生了什麼,並寫入表格或序列當前位置,以便您可以看看是否想要知道。
+1,很好的模板示例。 – DCookie