Results 1 to 2 of 2

Thread: Mysql QT Store procedure OUT param HELP

  1. #1
    Join Date
    Dec 2008
    Posts
    1
    Qt products
    Qt4

    Default Mysql QT Store procedure OUT param HELP

    Hi everyone
    im new with qt and i wanted to run an SP from mysql

    this is the code im using ..

    query.prepare("call pr_gethours(?,?)");
    query.bindValue(0,'2008-12-25');
    query.bindValue(1,0, QSql::Out);
    query.exec();
    i = query.boundValue(1).toDouble();
    and all i get from the boundvalue is 0, but when i test it with my query browser i get 42 ..
    so i was searching over the internet and i found this guy who has the same problem... 2005 ;S

    http://lists.trolltech.com/qt-intere...ad01437-0.html

    but no answer there T_T
    does anybody knows how to do this ?
    Thanks in advance =D

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Mysql QT Store procedure OUT param HELP

    Could you check what is the type of the variant returned by boundValue()? I'd suggest using bindValue() version that uses placeholder names instead of indexes, there is a chance it will start working.

Similar Threads

  1. Cannot create MySQL stored procedure / views from Qt
    By pshah.mumbai in forum Qt Programming
    Replies: 8
    Last Post: 8th October 2008, 16:22

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.