How to use a stored procedure in a select statement

This is a discussion on How to use a stored procedure in a select statement within the MySQL Database forums, part of the Database Forums category; We have a stored procedure (see stub below) and want to use the result in an sql-statement (MySQL 5....


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-25-2007
agez
 
Posts: n/a
Default How to use a stored procedure in a select statement

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;
....

Reply With Quote
  #2 (permalink)  
Old 05-25-2007
lark
 
Posts: n/a
Default Re: How to use a stored procedure in a select statement

== 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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:34 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0