Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

execute a stored procedure

HELLO, I HAVE A STORED PROCEDURE IN MY DATABASE CAN I run it from Phalcon

    $insert="BEGIN  PCS_INSERTAR_PRODUCTO("
    ."'$CODIGO' "
    .",'$DESCRIPCION'"
    .",'$TIPODO' "
    .",'' "
    .",'$OBSERVACION'"
    ." ,'$CODIG1'"
    .",'$CODIG2'"
    .",'$TIPOXX' "
    .",'$TIPO' "
    .",'$RCODIGO'"
    ." ,'$RECURSIVA'"
    .",'$FECHAI' "
    .",'$USUARIO'"
        .",'GUARDAR','$ESTADO');"
        ."END;";


31.6k

hello is a function in the database you want to run from Phalcon



30.0k

Hi,

I'm not really used with that. But I think that if you want to execute a database procedure (a procedure that is defined in the database itself), you will have to do that with raw SQL.



31.6k
Accepted
answer
edited Oct '16
$model = new OneOfYourModels();
$model->getReadConnection()->query(
"CALL nameOfYourProcedure()"
);