Results 1 to 9 of 9

Thread: Cannot create MySQL stored procedure / views from Qt

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Sep 2007
    Posts
    36
    Thanks
    5
    Thanked 3 Times in 1 Post

    Default Re: Cannot create MySQL stored procedure / views from Qt

    yeah i did that. it does not work.

    above code is incorrect. it has the me.exec(create_tables_sql)



    here is the correct code..

    Qt Code:
    1. QString create_tables_sql;
    2.  
    3. create_tables_sql =
    4. "DROP PROCEDURE IF EXISTS `test`.`GetStockTotal`;"
    5. "CREATE DEFINER=`root`@`localhost` PROCEDURE `test`.`GetStockTotal`(IN curstockid INT(11), OUT stocktotal DECIMAL(15,2))"
    6. "BEGIN"
    7. "DECLARE stocktotal FLOAT DEFAULT 0;"
    8. "SELECT opbalance INTO stocktotal from ledgers where curid = curstockid;"
    9. "END;";
    10.  
    11. me.exec(create_tables_sql);
    To copy to clipboard, switch view to plain text mode 

    It does drop the procedure but the create procedure does not work.
    Last edited by pshah.mumbai; 1st October 2008 at 10:00.

Similar Threads

  1. Accessing REF CURSOR in Stored Procedure from Qt
    By sureshbabu in forum Qt Programming
    Replies: 3
    Last Post: 11th August 2010, 16:51
  2. Stored procedure and ODBC
    By filya in forum Qt Programming
    Replies: 2
    Last Post: 15th March 2010, 09:40
  3. Accessing array (TABLE TYPE) in Stored Procedure from Qt
    By sureshbabu in forum Qt Programming
    Replies: 0
    Last Post: 26th September 2007, 12:36
  4. no record returns from stored procedure
    By mandal in forum Qt Programming
    Replies: 0
    Last Post: 26th April 2007, 15:45
  5. MySql Stored Procedures Woes
    By stevey in forum Qt Programming
    Replies: 9
    Last Post: 19th October 2006, 13:58

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.