如何调用MYSQL的存储过程,如何得到MYSQL存储过程的返回值?

how123 2005-07-18 11:15:31
如何调用MYSQL的存储过程,如何得到MYSQL存储过程的返回值?

请给出示例,谢谢
...全文
687 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
redliu 2006-03-27
  • 打赏
  • 举报
回复
adoCMD.CommandType = adCmdText
adoCMD.CommandText = "call prcModifyABA01('add','','" & txtProductID.Text & "','" & txtProductName.Text & "','" & txtCustomer.Text & "',@strErr)"
adoCMD.Execute

Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.LockType = adLockReadOnly
rs.CursorType = adOpenStatic

rs.Open "select @strErr", adoConnector

strErr = rs.Fields("@strErr").Value

If strErr <> "" Then
MsgBox strErr, vbOKOnly
End If
aiur2000 2005-10-19
  • 打赏
  • 举报
回复
mysql和sql server 一样吗?

if exists(select * from sysobjects where name ='hh' and type='p')
drop proc hh
go
create proc hh
@a int,@result int output
as
select * from 教工 where 姓名=@a
set @result=123

exec hh 3,5

返回的是记录集,如果写return ◎result就返回return的

我正在找如何同时返回记录集和out的方法,知道的请说一下
sztj 2005-10-08
  • 打赏
  • 举报
回复
是吧,MYSQL存贮过程的资料好象不多,哪里可以找到
梦断酒醒 2005-10-08
  • 打赏
  • 举报
回复
MYSQL最新发布的5才开始支持存储过程吧?此前是不支持的.估计少有人有经验了.

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧