问题描述:

I am trying to get codeigniter to run a stored procedure in oracle. I am passing the following into the stored_procedure function:

$param = array(array("name"=>"v_organisation_id", "value"=>1, "type"=>"OCI_B_INT", "length"=>-1));

$query = $this->db->stored_procedure("EXECUTE", "GET_ACCOMMODATION", $param);

It is returning the following error:

oci_bind_by_name() expects parameter 5 to be long, string given

The function sends the parameters into oci_bind_by_name() like this:

oci_bind_by_name($this->stmt_id, $param['name'], $param['value'], $param['length'], $param['type']);

It says that $param['type'] needs to be long and on the php docs it says that $param['type'] needs to be int $type = SQLT_CHR.

I have tried putting $param['type'] in without the quotes, but it then gives the following error message:

oci_bind_by_name(): ORA-01036: illegal variable name/number

相关阅读:
Top