开发者

Using stored procedures

Supposing i have a stored procedure fun(input, @val), and i want to call i开发者_Python百科t repeatedly, in a select. I tried like this:

select name, @val
from table
where {condition}
group by name

I need that @val be updated somewhere in the statement with:

 call fun(name, @val)

As the value of @val depends on the current "iteration".

How do i do?


Use a function that returns a value rather than using a stored procedure. Link to function creation syntax - http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜