DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: How to use UTL_FILE in procedure?

  1. #1
    Join Date
    Jan 2001
    Posts
    14

    Question

    Hi,

    I want to log results of a procedure in a system log file. I have declared

    handle UTL_FILE.FILE_TYPE;
    begin
    handle := UTL_FILE.FOPEN('/usr/x','logfile','w');
    UTL_FILE.PUTF('success of proc');

    But it gave sql error at line one (declaration).

    Can I declare and use UTL_FILE inside a procedure?

    Or it should be called from shell script? How to write the results in a log file?

    pl. suggest me a solution.

    thanks,
    satheesh

  2. #2
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    You need to have utl_file_dir setup for the database. Its one of the init.ora parameters. User writing to utl_file_dir should be having read,write permissions on the directory.

    [url]http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/appdev.817/a76936/utl_file.htm#998101[/url]
    [url]http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/appdev.817/a76936/utl_fil2.htm[/url]

    [Edited by sreddy on 02-09-2001 at 01:42 PM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width