dump with komma delimiters

fraso

New Member
Hi,
i searched a while on this forum but did not find the answer. I am not very
known of progress. I am sorry.

The dump file i get know the text like names are in "" but numbers are not.
so if i import it and use the space as delimiter, it split´s the names for example.

Import in PHP:
$sql = "LOAD DATA LOCAL INFILE '/var/www/files/zip/name.d' IGNORE INTO TABLE `".$in_temp_tab."` FIELDS TERMINATED BY ' ' ESCAPED BY '\\\\' LINES TERMINATED BY '\\r\\n'";

so, how do i tell my 9.1c progress with my fdumpall.p file (encoded??) that I want
komma separated fields?

name.d dump:
"40518" "105" "Bauer Natalia" "clerk" "" "bn" yes "" yes yes

So it imports like in php with LOAD DATA as

"40518"
"105"
"Bauer
Natalia"
"clerk"
""
"bn"
yes
""
yes
yes


I want the dumped name.d look like:

"40518","105","Bauer Natalia","clerk","","bn",yes,"",yes,yes <= Komma separated!

or

"40518" "105" "Bauer Natalia" "clerk" "" "bn" "yes" "" "yes" "yes" <= ALL WITHIN ""



thx,
fraso
 
use the DELIMITER option with the export:

eXample:
DEFINE STREAM sExport.

OUTPUT STREAM sExport TO VALUE("name.d":U).

FOR EACH sports2000.customer NO-LOCK :
EXPORT STREAM sExport DELIMITER ";":U sports2000.customer.
END.

OUTPUT STREAM sExport CLOSE.
 
Well, I found a simple way myself on the other side: mySQL.

SOLUTION:

Just add a ENCLOSED BY '"' to the mySQL Load Statement.

Then, mySQL is smart enough to understand the .d file and it is
pretty FAST! Got 50MB in dump in less than a minute into the database....

thanks for your help.

fraso
 
Back
Top