but my OUT bind type maybe number or string or array, or have any function can get OUT bind length?
class DBObj{
public function spExec($sql, $params){
$stid = oci_parse($this->con, $sql);
foreach ($params as $key => &$value)
{
if($value == 'sp_return')
// I'm not sure $len
// could I use something function get OUT bind length?
oci_bind_by_name($stid, $key, $r, $len);
else
oci_bind_by_name($stid, $key, $value);
}
oci_execute($stid, OCI_DEFAULT) or die($this->dbError($stid));
return $r;
}
}
$db = new DBObj();
// maybe this return number
$sql = "BEGIN :ret := aaa(:p1, :p2, :p3); END;";
$params = array(':ret' => 'sp_return', ':p1' => '1', ':p2' => '2', ':p3' => '3');
$result = $db->spExec($sql, $params);
echo $result;
// maybe this return string or array
$sql = "BEGIN :ret := bbb(); END;";
$params = array(':ret' => 'sp_return');
$result = $db->spExec($sql, $params);
echo $result;