Call Procedure with Oracle return in Codeigniter

1

I'm developing a system and in a part of the code, I need to call a procedure and it returns a value. How can I do this?

For the time being I did it and it did not work:

    $sql = "CALL P_VERIFICA_VALORES("
            . $this->_database->escape($dados['tipo']).","
            . $this->_database->escape($dados["setor"])."," // input
            . $dados["operador"]."," // input
            . $dados["mes"]."," // input
            . " @out1" //output
            .")";

    $this->_database->trans_start();
    $this->_database->query($sql);
    $query = $this->_database->query("SELECT @out1 as row_1");
    $this->_database->trans_complete();

You returned the following error:

Message: oci_execute (): ORA-00936: expression not found

    
asked by anonymous 19.09.2017 / 22:28

1 answer

1

You can call using the call_function

$this->db->call_function('P_VERIFICA_VALORES');

or in your case, passing the values

$this->db->call_function('P_VERIFICA_VALORES', $param1, $param2, etc..);
    
20.09.2017 / 14:25