Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

[MBS] SQL Plugin, MySQL, and Output Parameters (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] Added live chat to website
Next thread: [MBS] Last day: Omega Bundle


Re: [MBS] MBS Real Studio Audio Plugin crash   -   Garth Hjelte
  [MBS] SQL Plugin, MySQL, and Output Parameters   -   Troy Schultz
   Re: [MBS] SQL Plugin, MySQL, and Output Parameters   -   Christian Schmitz

[MBS] SQL Plugin, MySQL, and Output Parameters
Date: 30.01.11 09:31 (Sun, 30 Jan 2011 01:31:09 -0700)
From: Troy Schultz
Hello,

Could anyone give me a quick example of how to do output parameters with the sql plugin please?

Currently I have a stored procedure which returns a record set and two parameters after I iterate through the record set I get an error about not being able to find those named parameters.

Example.

cmd.setCommandText("Call stored_procedure(:inparam1, :inparam2, outparam1, outparam2)")
cmd.Param("inparam1").setAsShort(000)
cmd.Param("inparam2").setAsString("myString")

cmd.Execute()

if cmd.isResultSet then
while cmd.FetchNext
.... do something with result set ...
wend
end if

=?DDoDwDgDcD
In the above example what do I name the output parameters so that I can access them later?

If I do something like var = cmd.Param("outparam1").asStringValue I get an error saying that the
parameter "outparam1" cannot be found. Which according to the sqlapi documentation should work.

The only way that I have been able to get it to work is use the MySQL session vars like @x, etc..
Then calling a separate sql statement to retrieve the values from the MySQL session var.

Any pointers in the right direction would be appreciated.

Thanks,

Troy

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] SQL Plugin, MySQL, and Output Parameters
Date: 30.01.11 10:59 (Sun, 30 Jan 2011 10:59:08 +0100)
From: Christian Schmitz

On 30.01.2011, at 09:31, Troy Schultz wrote:

> Hello,
>
> Could anyone give me a quick example of how to do output parameters with the sql plugin please?

Well, you simply use the cmd.Param("outputname") function to get SQLParamMBS objects for the output values.

read more here:
http://www.sqlapi.com/HowTo/return_param.html

Greetings
Christian