Alpha Video Training
Results 1 to 3 of 3

Thread: MySQL Stored procedure

  1. #1
    Real Name
    Samuel Ezeala
    Join Date
    Jan 2016

    Default MySQL Stored procedure

    Hello Guys,
    Please i am having an issue with mysql stored procedures and xbasic, i think this xbasics is not flexible. Ok this is what i am trying to achieve:
    Make an Ajax call to a Stored procedure with three parameters (two input and one output), the get the out and use the output to populate a div tag.
    the code is below.
    			dim flags as L = conn.Execute("CALL SelectTrans(:arg1,:arg2,:arg3)",selectargs) ' This is the stored procedure
    			flags = conn.Execute("SELECT @name as t") ' trying to select the output parameter which works fine if i try it on mysql or heidi sql
    			flags = result.NextRow()
    all the output return false when i used firebug to check them....

    Please any better solution to this . thanks in anticipation

  2. #2
    Real Name
    pieter cremers
    Join Date
    Nov 2009

    Default Re: MySQL Stored procedure

    Hi Samuel,

    I use this syntax
    'we will call a mysql procedure to do the work
    dim strsql as c
    strsql = <<%sql%
    CALL `Procedure_F_ProeffacturenVerwerken`(:whatfaktruns_nummer,'', :whatuser);

    flag = cn.execute(strsql, args)

    if flag = .f. then
    'there was an error - close the connection and exit
    dim msg as c
    msg = "Could not create testinvoices. Error reported was: " + cn.CallResult.text
    msg = js_escape(msg)
    dim jscmd as c
    jscmd = "alert('" + msg + "');"
    ProcessTestInvoices= jscmd
    exit function
    end if
    dim rs as sql::ResultSet
    rs = cn.ResultSet

  3. #3
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Oregon, USA

    Default Re: MySQL Stored procedure

    I had some issues with the OUT parameter having the @ at the beginning, so I ended up doing this:

    vCall = "CALL calc_lines_display_values( :argJobno, @rslt, @kount )"
    crs = cnx.ResultSet
    vPLResult =
    vPLineCount = round(,0)

    in this case, Xbasic would not accept"@kount"), but works just fine.
    Pat Bremkamp
    MindKicks Consulting

Similar Threads

  1. MySQL Stored Procedure
    By Tasos in forum Application Server Version 11 - Web/Browser Applications
    Replies: 7
    Last Post: 07-22-2013, 02:08 PM
  2. Using Cursor in MySQL stored procedure
    By Pat Bremkamp in forum Application Server Version 10 - Web/Browser Applications
    Replies: 3
    Last Post: 12-16-2010, 01:28 PM
  3. mysql stored procedure
    By nlok888 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 7
    Last Post: 09-05-2010, 03:19 AM
  4. MySQL script/stored procedure runner
    By alanc in forum Archived Wishlist
    Replies: 2
    Last Post: 05-09-2008, 02:41 AM
  5. MYSQL stored procedure
    By asawyer13 in forum Web Application Server v7
    Replies: 1
    Last Post: 06-28-2006, 01:07 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts