ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

ocibindbyname() expects parameter 4 to be long, string given

May 22, 2009 2:56pm

Subscribe [2]
  • #1 / May 22, 2009 2:56pm

    albertone01

    3 posts

    Help,
    I’m trying to to execute an Oracle procedure:

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

    and this is the model 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—> Severity: Warning —> ociexecute() [function.ociexecute]: 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 / Jul 23, 2009 1:08am

    Ayo

    4 posts

    The array has to contain the type and length.

    EG.

    $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/

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases