473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

spooling data to csv file

10
Hi,
I want to spool data from my query to a csv file.
i have done it.
My query returns more than 31,000 rows.
It takes more than 1 hour to transfer data to the csv file.

Can anyone please help me to write code which reduces the time to transfer data.

Thanks.
Oct 18 '07 #1
4 5775
amitpatel66
2,367 Expert 2GB
Hi,
I want to spool data from my query to a csv file.
i have done it.
My query returns more than 31,000 rows.
It takes more than 1 hour to transfer data to the csv file.

Can anyone please help me to write code which reduces the time to transfer data.

Thanks.
Couple of suggesstions:

1. If you have toad, run the query in toad and SAVE the data as CSV

or

2. Make use of UTL_FILE package to write the data to the file
Oct 18 '07 #2
Surek
10
Couple of suggesstions:

1. If you have toad, run the query in toad and SAVE the data as CSV

or

2. Make use of UTL_FILE package to write the data to the file

I cant use UTL_FILE package. I dont have permissions to change the init.ora file.

Am using toad and now doing the data transfer manually. but i want that functionality to be incorporated in the code.
Oct 18 '07 #3
amitpatel66
2,367 Expert 2GB
I cant use UTL_FILE package. I dont have permissions to change the init.ora file.

Am using toad and now doing the data transfer manually. but i want that functionality to be incorporated in the code.
Raise a request with your DBA to modify the init.ora file.
Oct 18 '07 #4
Hi,

YOu need not use UTL_FILE to create csv file.

You can simply write a sql file like,

set lines 1000 pages 0 trimspool on
set colsep , =========> this sets the default column saperator in sql output to comma(,)
spool your_file_name
SELECT......
;
spool off
exit

Also, do some analysis. If the query takes long time to execute? or the writting process takes time?
I don't think the writting would take much time, if its around 30000 lines.

Cheers
Oct 19 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Domenico Discepola | last post by:
Hello all. Before my arrival at my current employer, our consultants physically set up our MSSQL 7 server as follows: drive c: contains the mssql engine drive d: contains the transaction log...
0
by: Auday Alwash | last post by:
Hi, A month ago, we were running out of disk space on a drive that stores the data file for a SQL Server 7 database. So I added a new drive and created a new data file on the primary filegroup...
7
by: Bob | last post by:
Hi, I am trying to use BULK INSERT with format file. All of our data has few bytes of header in the data file which I would like to skip before doing BULK INSERT. Is it possible to write...
12
by: Steven Bethard | last post by:
Ok, so I have a module that is basically a Python wrapper around a big lookup table stored in a text file. The module needs to provide a few functions:: get_stem(word, pos, default=None)...
2
by: nepdae | last post by:
Please forgive me, this is a long one. My 11-user Access 2000 database is having recurring corruption problems. The symptoms include the following: 1) corrupted fields in recently created or...
2
by: AB | last post by:
Hi to all, I have a problem about a importation of a file *.csv with SQL Server, through a bulk insert, called in a store procedure that a c# sw calls. This is the description of the error:...
10
by: HardySpicer | last post by:
I have a cvs data file orbit.csv and found this code. function ReadFile() { var fso, f1, ts, s; var ForReading = 1; fso = new ActiveXObject("Scripting.FileSystemObject"); f =...
2
by: phpnoob | last post by:
I have a php script that processes a form and then posts the user input to a data file on the server in a comma delimited format. For simplicity call the file "data.csv." The script is working...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this...
0
by: blehhhhh | last post by:
hi guys, So i have this java assignment where I have to create an employee class with given datatypes and have accessor methods in it. Along with that i have to create a text file(data file) with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.