Hi George,

To do it incrementally is not really an option, since i have to run it as a script during a short time-frame every night, and theres simply not time to process the files.

The outfile is about 2 - 10 Gb every time.

The tables have about 100 - 180 columns, and to do a COALESCE would create humongous sql-statements.

I might also have wrote it a bit ambigous in my question; I don't want the word "nothing", I really want the field to contain nothing - as in ''.

Regards,
/Johan - Ua, Sweden


George Law wrote:
Johan,

have you thought about doing this incrementally?
ie - 25% at a time x 4

to show something for NULL, you can use the COALESCE function.

ie - COALESCE(column,'nothing')

--
George Law
VoIP Network Developer
864-678-3161
[EMAIL PROTECTED]
MSN: [EMAIL PROTECTED]
-----Original Message-----
From: Johan Lundqvist [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 10:16 AM
To: mysql@lists.mysql.com
Subject: Outfile syntax and out of memory

Hi,

I need to extract some data to a textfile from a big database.


If I try to do like this:
mysql < queryfile.sql > outfile.txt

"outfile.txt" it looks something like:
"OrderID", "Quant", "OrdrDate", "code1", "code2"...
10021, 12, 20060412, 23, 95...
10022, 5, 20060412, , 75...

But, I never get a complete file. I get a out of memory error after a hour or 2!!


If I instead insert the following code in queryfile.sql:
"INTO OUTFILE 'outfile.txt'"

Now my outfile.txt don't get the first row with the column names, and any NULL values are exported as "\N".

This is a big problem, cause the import function that exist where I send

the data only accept the format I get using "mysql < queryfile.sql > outfile.txt".

Any help??! Ideas??

Can I in any way format my output to print the column names and print NULL values as 'nothing'??

Regards,
/Johan Lundqvist


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to