Results 1 to 3 of 3

Thread: MySQL QSqlQuery problem

  1. #1
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default MySQL QSqlQuery problem

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: MySQL QSqlQuery problem

    What does
    Qt Code:
    1. abfrage->lastError()
    To copy to clipboard, switch view to plain text mode 
    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.

  3. #3
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL QSqlQuery problem

    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.

Similar Threads

  1. Qt 4.5.1 / MySQL 5.1, QSqlQuery::lastError() 1295
    By wdezell in forum Qt Programming
    Replies: 1
    Last Post: 21st July 2009, 15:36
  2. QSqlQuery, MySQL, "show engines;"
    By mbaszczewski in forum Qt Programming
    Replies: 0
    Last Post: 16th July 2009, 19:25
  3. QSqlQuery problem
    By MarkoSan in forum Qt Programming
    Replies: 14
    Last Post: 14th January 2008, 22:50
  4. QSqlQuery problem
    By MarkoSan in forum Qt Programming
    Replies: 11
    Last Post: 18th December 2007, 13:25
  5. QSqlQuery problem
    By dragon in forum Newbie
    Replies: 5
    Last Post: 22nd December 2006, 17:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.