Code: Select all
$args = array(
array('name'=>'request_id','value'=>5,'length'=>10,'type'=>OCI_B_INT)
,array('name'=>'vessel_length_overall','value'=>NULL,'length'=>10,'type'=>OCI_B_INT)//OUT PARAMS
,array('name'=>'total_engine_hp','value'=>NULL,'length'=>10,'type'=>OCI_B_INT)//OUT PARAMS
.....................................................
);
$return = $this->db->stored_procedure('PKG_REQUEST','PR_GET_SUITE_BASELINE',$args);
and the function that binds parameter is like this:
Code: Select all
/* EXACT COPY FROM CODE IGNITER*/
function _bind_params($params) {
if (!is_array($params) OR !is_resource($this->stmt_id)) {
return;
}
foreach ($params as $param) {
foreach (array('name', 'value', 'type', 'length') as $val) {
if (!isset($param[$val])) {
$param[$val] = '';
}
}
ocibindbyname($this->stmt_id, $param['name'], $param['value'], $param['length'], $param['type']);
}
}
Code: Select all
/* RETURN ARRAY HOLDS THE OUT PARAMETER VALUES*/
function _bind_params($params,&$return=array()) {
if (!is_array($params) OR !is_resource($this->stmt_id)) {
return;
}
foreach ($params as $param) {
$return[$param['name']]=$param['value'];
foreach (array('name', 'value', 'type', 'length') as $val) {
if (!isset($param[$val])) {
$param[$val] = '';
}
}
ocibindbyname($this->stmt_id, $param['name'], $return[$param['name']], $param['length'], $param['type']);
}
}
These are what I've already tried :
So I've tried passing the $args,$param array by reference(although I think now php5 does it by defult!! don't know), and I checked out some other forums and what they had was something like this (of course didn't work):
Code: Select all
$args = array(
array('name'=>'request_id','value'=>retValue($params, 'request_id'),'length'=>10,'type'=>OCI_B_INT)
,array('name'=>'vessel_length_overall','value'=>&$val1,'length'=>10,'type'=>OCI_B_INT)
.............