Welcome Guest, Not a member yet? Register   Sign In
ocibindbyname() expects parameter 4 to be long, string given
#1

[eluser]albertone01[/eluser]
Help,
I'm trying to to execute an Oracle procedure:

Code:
procedure SP_INS_TOKEN (
p_token    varchar2
) is
begin
insert into web_tokens values (p_token, sysdate);
end;

and this is the model code:
Code:
$params = array (array ('name' => ':p_token', 'value' => 'test'));
$this->db->stored_procedure('PKG_WEB_TOKEN', 'SP_INS_TOKEN' , $params);

But i get this error:

ERROR - 2009-05-22 19:55:07 --> Severity: Warning --> ocibindbyname() expects parameter 4 to be long, string given E:\WORKS\system\database\drivers\oci8\oci8_driver.php 278
ERROR - 2009-05-22 19:55:07 --&gt; Severity: Warning --&gt; ociexecute() [<a href='function.ociexecute'>function.ociexecute</a>]: ORA-01008: not all variables bound E:\WORKS\system\database\drivers\oci8\oci8_driver.php 152


If I execute a sp without any parameters, it works!!

WHY??!?!
help!
#2

[eluser]Ayo[/eluser]
The array has to contain the type and length.

EG.

Code:
$params = array(
                        array('name'=>':P_ID', 'value'=>1, 'type'=>SQLT_CHR, 'length'=>-1),
                        array('name'=>':P_LOGIN', 'value'=>'ade', 'type'=>SQLT_CHR, 'length'=>-1)
                        );

check out my other post on this topic.
http://ellislab.com/forums/viewthread/123884/




Theme © iAndrew 2016 - Forum software by © MyBB