?
Solved

Export Long data type to csv

Posted on 2007-11-28
5
Medium Priority
?
2,250 Views
Last Modified: 2008-02-16
Hi All!,

I wonder if someone dealt with this problem. I have to export into a csv file a long data type field. I work with Oracle 7.3

   set termout off
   set hea off
   set pagesize 0
   spool c:\export.csv
   select       PR_PK||','||PR_DESC
   from F_PROJECT_FILE;
   spool off      

Thank you.


Claudio
0
Comment
Question by:serco_it
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 35

Accepted Solution

by:
johnsone earned 1000 total points
ID: 20365993
I don't think this is possible with SQL*Plus.

You would need to set long to some value large enough to accomodate your largest long.  The maximum appears to be 1073741824, which could be smaller than your long.

You also need to set linesize, the problem with that is that the maximum value for linesize is 32767.  Therefore, SQL*Plus is going to put line breaks into your data every 32767 characters.  I don't think that is what you want.
0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 20372075
I think that setting long and linesize should get the output you wanted.

Try it and if you are not getting the data output format you wanted, can you post the sample data for 1 record in the table and the expected output.

Also put the current output you are getting so that we can try to help with that to get the expected output.

Thanks
0
 
LVL 35

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 1000 total points
ID: 20374643
I also had to do that with a 7.3 database (more than 10 years ago) and I had the problem that johnsone described: SQL*Plus will put a linefeed character after writing enough charcters to reach your "linesize" value.  I had to then open the file with a text editor, and remove these unwanted line breaks.

Depending on the number of records you have to export, and on the actual size of the data in the column, this may or may not be a significant problem for you.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20910334
Forced accept.

Computer101
Community Support Moderator
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question