How to use a stored procedure in a select statement

  • Follow


We have a stored procedure (see stub below) and want to use the result
in an sql-statement (MySQL 5.0.38). Is that possible?



.....
SELECT FLOOR(uskill*mRange/(maxskill*1.001)+1) AS skill;
....

0
Reply helmut.ziegler (1) 5/25/2007 12:26:16 PM

== Quote from agez (helmut.ziegler@gmail.com)'s article
> We have a stored procedure (see stub below) and want to use the result
> in an sql-statement (MySQL 5.0.38). Is that possible?
> ....
> SELECT FLOOR(uskill*mRange/(maxskill*1.001)+1) AS skill;
> ...

If your purpose is to return a value, then you'll be better off utilizing
functions. for stored procedures to work, they have a syntax like this:

call uskill;

which i don't think you can put in a select statement; however, if you put that
same syntax in a function, you can easily call that function from any select
and/or stored procedure.

hope this helps.
--
POST BY: lark with PHP News Reader
0
Reply lark 5/25/2007 2:05:22 PM


1 Replies
319 Views

(page loaded in 0.06 seconds)

Similiar Articles:













7/26/2012 2:34:47 PM


Reply: