selecting from all_objects
From: Tom Zamani <tomz_at_redflex.com.au>
Date: Wed, 8 Mar 2000 13:10:18 +1100
Message-ID: <8a4d9n$hoi$1_at_perki.connect.com.au>
Hi there could you please help me with this problem. attached is the procedure which creates a file for given package body and given user.
The owner of this procedure has DBA privilage.
OUTPUT VARCHAR2(32000);
v_FileHandle UTL_FILE.FILE_TYPE;
v_FileDir varchar2(100) default '/u02/oradata/SID/orafile';
UTL_FILE.fclose(v_FileHandle);
EXCEPTION WHEN OTHERS THEN
dbms_output.put_line(SUBSTR(SQLERRM,1,1000)); END Received on Wed Mar 08 2000 - 03:10:18 CET
Date: Wed, 8 Mar 2000 13:10:18 +1100
Message-ID: <8a4d9n$hoi$1_at_perki.connect.com.au>
Hi there could you please help me with this problem. attached is the procedure which creates a file for given package body and given user.
The owner of this procedure has DBA privilage.
BUT it does not select and records, this is only for package body.
Is there any way that I could do this.
Thanks tom
Procedure COMP_PACKAGE_BODY(v_filename in varchar2 default null,
v_user in varchar2 default null, v_pack_name in varchar2 default null )IS
OUTPUT VARCHAR2(32000);
v_FileHandle UTL_FILE.FILE_TYPE;
v_FileDir varchar2(100) default '/u02/oradata/SID/orafile';
begin
V_FileHandle := UTL_FILE.FOPEN(v_FileDir,v_filename,'w'); for c1 in
select
a.text
from
all_source a
where
[Quoted] a.OWNER = upper(v_user) and a.name = v_pack_name and a.TYPE = 'PACKAGE BODY' order by a.line) loop --UTL_FILE.PUT(v_FileHandle,c1_rec.text); dbms_output.put_line('hi'); utl_file.put(v_FileHandle,c1.text);end loop;
UTL_FILE.fclose(v_FileHandle);
EXCEPTION WHEN OTHERS THEN
dbms_output.put_line(SUBSTR(SQLERRM,1,1000)); END Received on Wed Mar 08 2000 - 03:10:18 CET