什么是相当于Oracle的REF CURSOR在MySQL? [英] What is the equivalent of Oracle’s REF CURSOR in MySQL?

查看:238
本文介绍了什么是相当于Oracle的REF CURSOR在MySQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在mysql中做一个procdure,返回一个数组的结果,我曾经使用oracle ref游标,但在mysql不知道如何继续,
我必须传递参数太...



任何人都知道我能做什么,还是有个例子来告诉我?非常感谢...

解决方案

MySQL中没有REF CURSOR的模拟。存储过程和函数允许只传递和返回标量数据类型,请参见这里 - CREATE PROCEDURE和CREATE FUNCTION语法



MySQL无法操作数组。解决方法是使用(或TEMPORARY TABLE )。

此外 - 利用视觉对象编辑器和存储过程调试器,位于 dbForge Studio for MySQL


I am trying to make a procdure in mysql that returns me an array with the result, I used to do with the oracle ref cursor, but in mysql do not know how to proceed, I have to pass parameters too...

Anyone know how I can do, or have an example to show me? Thank you very much...

解决方案

There is no analog of REF CURSOR in MySQL. Stored procedures and functions allow to pass and return only scalar datata types, see the reference here - CREATE PROCEDURE and CREATE FUNCTION Syntax.

MySQL cannot operate with arrays. A workaround is to use a table (or TEMPORARY TABLE).

Also - take advantage of visual object editors and stored procedure debugger in dbForge Studio for MySQL.

这篇关于什么是相当于Oracle的REF CURSOR在MySQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆