Call Procedure with Oracle return in Codeigniter

Asked

Viewed 139 times

1

I am developing a system and in a part of the code, I need to call a precedent and it returns me a value. How can I do that?

For now I did so and it didn’t 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();

Returned the following error:

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

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..);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.