Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Posts
    29

    Unanswered: Pushing Data from a Query to A flat file in UNIX folder.

    Hi,
    I am new to working on Oracle in Unix. I have table which has details abt Purchase Orders. I want to push the detail of a Particular Query on a Purchase Order number to a flat file and save the file in directory in Unix. Is there any means to do it. Once I get this procedure what I plan to do is create a job which will regularly push the details of the query results into the flat file and save it. Hope it is something similiar to the Spool on/off in Oracle NT. Can anyone please help me.
    Regards
    Dinesh

  2. #2
    Join Date
    Jun 2002
    Location
    Indianapolis
    Posts
    21
    There are several ways to do this. I guess it really depends on how you want to approach the problem.

    If it can be done outside of the database with cron as the scheduler:
    -Perl is a great tool for this
    -So is java
    -write a tiny script that logs on, executes a query, and exits. Redirect the output to a file. ie

    test.sql
    select count(*) Num_Sessions from v$session;
    exit

    Setup cron to fire this off:
    sqlplus uname/password@db @test.sql >test.txt

    You can use tail and head to chop off the server info.

    If you want this done in the database with dbms_jobs, you can use utl_file. (http://oradoc.photo.net/ora817/DOC/a...ile.htm#998101)

    These are just a few ideas.

    --Brice

Posting Permissions

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