Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 24th, 2002, 04:25 PM
bvillepc bvillepc is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Tulsa, OK
Posts: 90 bvillepc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 26 m 56 sec
Reputation Power: 13
Exclamation Oracle SELECT INTO OUTFILE problem

Hello, I am using Oracle and trying to output the returned query data to a TAB Delimited file. I tried using

"SELECT columns FROM tables INTO OUTFILE 'dir/filename.txt' FIELDS TERMINATED BY '\t' WHERE conditions"

But Oracle just gives the Error:
"Warning: OCIStmtExecute: ORA-00905: missing keyword"

Am I doing this incorrectly or does Oracle just not support it, or is there another way to send the data to a file? I am currently sending it to an outfile by looping through each row, storing it in a variable, and then writing it to a file, but it takes quite a while, since the query returns a LOT of data. Thanks in advance.

-Chris C.

Reply With Quote
  #2  
Old April 25th, 2002, 04:12 PM
tron's Avatar
tron tron is offline
SwollenMember
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: the master control
Posts: 264 tron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 14 m 57 sec
Reputation Power: 13
here is what i have done when i need to output a query to a tab delimited file. basically just use the spool command. if you really want to get crazy...put the following into a shell script:


. /etc/profile
ORACLE_SID=<instancename>;export ORACLE_SID
. oraenv

sqlplus name/pass << EOF

SET LINESIZE 500 FEEDBACK OFF TRIMSPOOL ON TERMOUT OFF HEAD OFF PAGESIZE 0 term off

SPOOL /directory/name/outputfile.dat

SELECT TO_CHAR(id) || chr(9) || name || chr(9) || type
FROM tbl_something;

SPOOL OFF

EXIT;
EOF

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Oracle SELECT INTO OUTFILE problem

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap