Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: selecting from all_source
Hi, here is the procedure with little changes
Procedure COMP_PACKAGE_BODY(v_filename in varchar2 default null,
v_user in varchar2 default null, v_pack_name in varchar2 default null )IS
begin
V_FileHandle := UTL_FILE.FOPEN(v_FileDir,v_filename,'w'); -- for noproblem runing UTL_FILE package
-- must be setted value "utl_file_dir" in ORAINIfile on database
for c1 in (select a.text from all_source a
where a.OWNER = upper(v_user) and a.name = v_pack_name and a.TYPE = 'PACKAGE BODY' order by a.line) loop dbms_output.put_line('hi'); utl_file.put(v_FileHandle,c1.text);end loop;
Tom Zamani <tomz_at_redflex.com.au> píše v diskusním
příspěvku:8a4dcn$hr3$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
> 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 - 02:57:57 CST
![]() |
![]() |