giovedì 21 giugno 2012

MySql - Salvataggio di tabella su file

Salvataggio di tabella su file:
SELECT * FROM prova
INTO OUTFILE '/mnt/prova.csv'
FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n';

Se Infobright potrebbe dare il seguente errore:
The query includes syntax that is not supported by the Infobright Optimizer. Either restructure the query with supported syntax, or enable the MySQL Query Path in the brighthouse.ini file to execute the query with reduced performance. 

Per risolverlo eseguire prima lo statement:
set @bh_dataformat = 'txt_variable';

Caricamento da file:
LOAD DATA INFILE '/mnt/prova.csv' INTO TABLE prova1

Nessun commento:

Posta un commento