Executing Procedure
am 19.05.2006 12:38:40 von Kavitha KannanDISCLAIMER:
Information transmitted by this e-mail may be proprietary to Ramco Systems Ltd., and / or the authors of the information and is intended for use only by the individual or entity to which it is addressed, and may contain confidential or legally privileged information. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are not authorised to access, read, disclose, copy, use or otherwise deal with it and any such actions are prohibited and may be unlawful.
Internet communications cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, arrive late or contain viruses. Ramco Systems Limited therefore does not accept liability for any errors, omissions, viruses or computer problems experienced as a result of this transmission.
If you have received this e-mail in error, please notify us immediately at mail to: mailadmin@rsi.ramco.com and delete this mail from your records. Notice is hereby given that no representation, contract or other binding obligation shall be created by this e-mail.
Hi
I am presently working on a migration project for MSSQL to Mysql. We have migrated about 65000 procedures successfully to mysql ver. 5.0.17.
We are now evaluating Mysql as a backend for our base product which demands for high backend transactions.
Now we would like to call those sps from VB 6.0 using My ODBC 3.51 driver.
Things went fine untill i call a procedure with outparams. while calling a procedure with OUT params it returns an error.
>> OUT or INOUT argument 2 for routine
here is the procedure i am calling
---------------------------------------------------
create procedure ef4 (IN v_g int,OUT v_h int)
begin
set v_h=v_g + 20;
select v_g;
end;
VB code i am using to call procedure
-------------------------------------------------------
dim outvar as integer
conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;UID=root;PWD=samsung26;DATABASE=DEP DB;" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 163841
conn.CursorLocation = adUseClient
conn.Open
Set objSPCommand = New ADODB.Command
objSPCommand.ActiveConnection = conn
With objSPCommand
.Parameters.Append .CreateParameter("v_g", adInteger, adParamInput, 10, "40")
Parameters.Append .CreateParameter("v_h", adInteger, adParamOutput, 0, 0)
'//Parameters.Append .CreateParameter("v_h", adInteger, adParamOutput, 0, varptr(outvar)) ' i tried to send address of the variable
End With
objSPCommand.CommandTimeout = 0
objSPCommand.CommandType = adCmdText
objSPCommand.CommandText = "call ef4(?,?)"
Set rs = objSPCommand.Execute
If Not rs.EOF Then
Do While Not rs.EOF // here i have no problem as if i get only result set
MsgBox rs(0)
rs.MoveNext
Loop
End If
rs.Close
MsgBox objSPCommand.Parameters("v_h").Value
conn.Close
'*********************************END*********************** *
I understand that second arguments should be sent as address of the variable to get the returned value. what is the work around for this problem.
Please let me know the fix if any at the earliest.
Awaiting your reply.
Kavitha.k
--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dgcdmo-myodbc@m.gmane.o rg