Go Back   Forum Care Forums > Development Reference Area > MySQL Discussion

Reply
 
LinkBack Thread Tools Display Modes
How to use a stored procedure in a select statement
Old
  (#1)
agez
Guest
 
Posts: n/a
Default How to use a stored procedure in a select statement - 06-04-2007, 07:58 AM

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

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: How to use a stored procedure in a select statement
Old
  (#2)
lark
Guest
 
Posts: n/a
Default Re: How to use a stored procedure in a select statement - 06-04-2007, 07:58 AM

== Quote from agez (EMAIL REMOVED)'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
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top