Hello Dossy,
Actually I'm not sure how to call mysql procedures using nsmysql. Here
two codes that i have lately tried, one uses ns_db select and the
other uses ns_db sp_start calls.
<%
set pool "mysql";
catch { set db [ns_db gethandle $pool] }
set sqlstmt "call MYPROC('SCANRES','2007-10-24 00:00:01','2007-10-24
23:59:59','%','%','%','%','%','%','%')";
if {[catch {ns_db select $db $sqlstmt} row]} {
ns_adp_puts "$row";
} else {
array set rowdata [ns_set array $row];
ns_adp_puts "[array get rowdata]";
}
catch { ns_db releasehandle $db }
%>
Output:
Database operation "select" failed (exception Error, "PROCEDURE
MYDB.MYPROC can't return a result set in the given context")
When i use the ns_db sp_start i'm also getting error. here's an
example code using sp_start:
<%
set pool "mysql";
catch { set db [ns_db gethandle $pool] }
set sqlstmt "MYPROC('SCANRES','2007-10-24 00:00:01','2007-10-24
23:59:59','%','%','%','%','%','%','%')";
if {[catch {ns_db sp_start $db "MYPROC"} spstart]} {
ns_adp_puts "ns_db sp_start ERROR:$spstart";
} else {
ns_adp_puts "ns_db sp_start SUCCESS:$spstart";
}
%>
Output:
ns_db sp_start ERROR:Database operation "sp_start" failed
kind regards,
shedis
On Oct 24, 5:30 pm, Dossy Shiobara <[EMAIL PROTECTED]> wrote:
> On 2007.10.24, Shedi Shedi <[EMAIL PROTECTED]> wrote:
>
> > Does anyone have an example of calling a procedure in backend mysql
> > database?
> > I have had not luck with ns_db select and ns_db exec.
>
> How about sharing us the actual code you've tried and perhaps someone
> can point out what you need to change.
>
> -- Dossy
>
> --
> Dossy Shiobara | [EMAIL PROTECTED] |http://dossy.org/
> Panoptic Computer Network |http://panoptic.com/
> "He realized the fastest way to change is to laugh at your own
> folly -- then you can let go and quickly move on." (p. 70)
>
> --
> AOLserver -http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to <[EMAIL
> PROTECTED]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
> field of your email blank.
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.