[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Creating Oracle Log File

Posted on 2004-11-15
2
Medium Priority
?
325 Views
Last Modified: 2006-11-17
Hello,

I have created an Oracle 9i PL/SQL procedure that will load records from one database into another.  I want to create a log file at the end of the run that will be stored on the database server (or some other network server) that contains information about how many records processed and how many failed during the run.  What is the code to do this within my procedure?

Thanks,
Chris
0
Comment
Question by:ccorrente
2 Comments
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 12587369
Use the UTL_FILE package to write log info to disk.
0
 
LVL 12

Accepted Solution

by:
geotiger earned 500 total points
ID: 12587796

Or you could create a external table and store the statistic about your data loads in the table. Since the external table reside outside your database as plain text file, you can view the file using other tools as well.

For example,

SQL> CREATE TABLE emp_ext
      (
      empcode NUMBER(4),
      empname VARCHAR2(25),
      deptname VARCHAR2(25),
      hiredate date
      )
  ORGANIZATION EXTERNAL
    (
      TYPE ORACLE_LOADER
      DEFAULT DIRECTORY ext_tables
      ACCESS PARAMETERS
      (
        RECORDS DELIMITED BY NEWLINE
        FIELDS TERMINATED BY ','
        MISSING FIELD VALUES ARE NULL
      )
      LOCATION ('emp_ext1.dat','emp_ext2.dat')
    )
  REJECT LIMIT UNLIMITED;

Table created.



You can find details about external table at this link: http://www.dbasupport.com/oracle/ora9i/External_Tables9i.shtml
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question