PDA

View Full Version : MySQL QSqlQuery problem



Erni35
15th September 2010, 16:28
Hi,

(surprise, surprise) I have a little problem.

I want to execute the following Query:
abfrage->exec("LOAD DATA LOCAL INFILE '/media/Daten/Qt4/kader3.csv' INTO TABLE " + DB->tabelle + "_kader FIELDS TERMINATED BY ';' IGNORE " + QString::number(beginn) + " LINES (@dummy1, @dummy2, @dummy3, @dummy4, @dummy5, @dummy6) SET sp_nr = @dummy1, name = CONCAT(@dummy2,', ', @dummy3), DRV_nummer = 'DE-00'");

Taken without the first quotes before and after the file name works. But no result in the database because of false SQL-Question. With the quotes I have a

Name des Signals :
SIGSEGV
Bedeutung :
Segmentation fault

Why? The query works with quotes in the MySQL-Query Browser.

Kindly,
Erni35

Lykurg
15th September 2010, 16:43
What does
abfrage->lastError()says and debug the crash and please post the back trace if you don't understand it. Maybe your program crashes because of a other line that is invoked if your abfrage was okay.

Erni35
15th September 2010, 22:14
I couldn't write this. Because the debugger didn't reach this line. The crash comes on the line with the exec(). I insterted a stop point for the debugger right on this line and F10 for the next step results in this segmentation fault.

Kindly.