If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Export from Table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-23-11, 01:21
donraja_ht donraja_ht is offline
Registered User
 
Join Date: Sep 2007
Posts: 56
Export from Table

Hello all,

I would like to export some fields from a table in DB in a txt (log) file, is this possible, I know that sqlldr is used to load data into tables but here i require to output the fields of some table into a txt file or a log file. the table contains some fields which are required in the log file.

please let me know as how to go about this.

Thanks and regards
Reply With Quote
  #2 (permalink)  
Old 12-23-11, 05:37
singhipst singhipst is offline
Registered User
 
Join Date: Jul 2006
Location: Bangalore
Posts: 57
you could spool the output of your query into file.

ex:

spool /tmp/out
set pagesize 0;
set linesize 0;
set echo off;
set header off;
select * from emp;
spool off
__________________
Ritesh Kumar Singh
IBM Certified DB2 DBA for LUW
**Knowledge Is Theft If Not Shared !!**
Reply With Quote
  #3 (permalink)  
Old 12-23-11, 05:49
donraja_ht donraja_ht is offline
Registered User
 
Join Date: Sep 2007
Posts: 56
Thanks,

It works as required :-)
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

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