Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > Pushing Data from a Query to A flat file in UNIX folder.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-26-02, 09:05
dineshyadav dineshyadav is offline
Registered User
 
Join Date: May 2002
Posts: 29
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
Reply With Quote
  #2 (permalink)  
Old 06-26-02, 20:38
Brice Brice is offline
Registered User
 
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On