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 Oracle table (data) to file.txt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Mar 2004
Posts: 6
Export Oracle table (data) to file.txt

I want to export a table of oraculo 7 to a text file, this text file to concern it in Access.
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Jan 2004
Location: Germantown, MD
Posts: 34
Re: Export Oracle table (data) to file.txt

Quote:
Originally posted by ferlinux
I want to export a table of oraculo 7 to a text file, this text file to concern it in Access.
I think I understand your question... If so, try this:

-- Script starts here
/*
Make sure you replace "my_table" with the actual table name.
And, do a describe of the table and replace the field1, field2, etc.
with your column names.

This script will create a comma delimited file named: c:\myfile.txt
*/

set head off -- this will turn off your column name heading
spool c:\myfile.txt

select field1||', '||field2||', '||field3
from my_table;
spool off -- turn spooling off
set head on -- turn the heading parameter back on

-- end of script

I hope this helps,
Rip
__________________
"The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing. "
- Albert Einstein
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Mar 2004
Posts: 6
Ok, you can say to me where to apply this, to make all this passage by step.
Thank you very much to collaborate to me, greetings
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Jan 2004
Location: Germantown, MD
Posts: 34
SQL*Plus...

1. Create a sql directory in the root of your C drive.
2. Using a text editor, create a file using the data listed above... Save it as c:\sql\myscript.sql.
3. Go into SQL*Plus as the table owner.
4. Type: @c:\sql\myscript.sql

If you are using Unix, change the c:\sql\ to ~/sql/
__________________
"The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing. "
- Albert Einstein

Last edited by the Oracle; 03-31-04 at 14:04.
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Mar 2004
Posts: 6
Cool

Excuse that bothers to you, but is urgent to solve the problem to me that I have with oracle7, I need but detail the solution that you gave me.
Reply With Quote
  #6 (permalink)  
Old
Registered User
 
Join Date: Mar 2004
Posts: 6
Thanks, have a complete example, because not nothing of oracle7 for Windows/unix.
Reply With Quote
  #7 (permalink)  
Old
Registered User
 
Join Date: Jan 2004
Location: Germantown, MD
Posts: 34
no worries...

I think.
__________________
"The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing. "
- Albert Einstein
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