faqts : Computers : Programming : Languages : PHP : Database Backed Sites : Sybase

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 2 people (50%) answered Yes
Recently 1 of 2 people (50%) answered Yes

Entry

I tried to get output from a procedure executing on sybase throw php,but only '0' returns!Why ?

Aug 21st, 2001 01:56
wen ke, Wolfgang Mueller, wenk


Which procedure you are using?
I define this procedure as following:
create proc circul.renewal
	@book_barcode 	char(14),
	@department_id 	char(2),
	@user_id       	char(4),
	@retu          	int 			output,
	@interval      	int 			output,
	@err_msg       	varchar(200) 		output,
	@period        	int 			output,
	@feast_p       	int 			output
as
...
***********************************************************
and I ececute the proc in my .php as fllowing:
<?php
include "../include/connect.php";
$ubarcode='21113000694135';
$departid='70';
$userid = 'web';    
$sql = "declare @retu_out int,@interval_out int ,@err_msg_out varchar
(200),@period_out int,@feast_p_out int\n";
$sql.= "exec circul.renewal '$barcode','$departid','$userid',@retu_out 
output,@interval_out output,\n";
$sql.= "@err_msg_out output,@period_out outpt,@feast_p_out output \n ";
$sql.= "select retu=@retu_out ,err_msg=@err_msg_out  ";
$query=sybase_query($sql);
if (!$query){
    echo '执行存储过程失败!<br>';
}else{
    echo '执行存储过程成功!<br>';
    $array = sybase_fetch_array($query);
    echo $array[err_msg] .'<br>';	
	echo $array[retu] .'<br>';	
}
...
?>
only '0' returns while the $sql works in SQL ADVANTAGE.