MYSQL ERROR: PROCEDURE can't return a result set in the given context -


i new stored procedure in mysql

this procedure returning difference of date excluding weekends, returns error

#1312 - procedure blog1.daycount can't return result set in given context

this procedure

drop procedure if exists daycount;  create procedure daycount( d1 date, d2 date )  select dd.idiff, dd.idiff - dd.iweekenddays iworkdays, dd.iweekenddays  (    select      dd.idiff,      ((dd.iweeks * 2) +       if(dd.isatdiff >= 0 , dd.isatdiff < dd.idays, 1, 0) +       if (dd.isundiff >= 0 , dd.isundiff < dd.idays, 1, 0)) iweekenddays    (      select        dd.idiff,        floor(dd.idiff / 7) iweeks,        dd.idiff % 7 idays,        5 - dd.istartday isatdiff,        6 - dd.istartday isundiff      (        select          1 + datediff(d2, d1) idiff,          weekday(d1) istartday        ) dd    ) dd  ) dd ;    call daycount( '2009-8-1','2009-9-15');  

check stored proc in mysql console, if works fine should check call php. found same problem happen other people.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -