Page 1 of 1

adodb PrepareSP calling SP in mysql problem

Posted: Mon Apr 21, 2008 8:28 pm
by yacahuma
Hello,


This problem is specific to adodb library. I've called stored procedures from oracle without problems. Now I am using a mysql stored procedure. It seems my syntax is wrong.

The stored procedure
create_order_from_basket(
IN P_customer_id INT,
OUT P_order_id INT,
OUT P_out_status CHAR(1),
OUT P_out_status_code VARCHAR(32))

The code

Code: Select all

 
  //tried this
  $stmt = $this->cn->PrepareSP('call create_order_from_basket '); 
 
  //and this (option2)
  $stmt = $this->cn->PrepareSP(' create_order_from_basket '); 
 
  //and this
  $stmt = $this->cn->PrepareSP(' create_order_from_basket ((:P_customer_id,:P_order_id,:P_out_status,:P_out_status_code)) '); 
 
     $this->cn->InParameter($stmt,$customer_id,'P_customer_id');
     $this->cn->OutParameter($stmt,$P_order_id,'P_order_id');
     $this->cn->OutParameter($stmt,$P_out_status,'P_out_status');
     $this->cn->OutParameter($stmt,$P_out_status_code,'P_out_status_code');
 
none of the option above seems to work. Sometimes i get sql syntax error. In option 2 I get an error saying the the procedure is expecting 4 parameters and zero are sent.


Any ideas?


Thank you

Re: adodb PrepareSP calling SP in mysql problem

Posted: Thu Jan 26, 2012 5:49 pm
by ederrafo
hello.
that code is valid when using Oracle but not with mysql.
I do so
//$stmt = "CALL sp_epe_ContrastChain('1,2,3',@ProductCode)";
//$rsstmt = "select @ProductCode AS label";
//$rs = $db->Execute($stmt);
//$rsstmt = $db->Execute($rsstmt);
//$dato = $rsstmt->GetRows();
if you, did you find a function that makes adodb, let me know please