vendredi 27 novembre 2015

H2: Use custom function to mock Oracle procedure?

Consider following Oracle Procedure

PROCEDURE dbms_alert_signal(p_rc OUT NUMBER,
                            name    IN VARCHAR2,
                            MESSAGE IN VARCHAR2)

I would like to mock this procedure as a H2 custom function because we do automated tests with H2

what i tried is

drop alias if exists DBMS_ALERT_SIGNAL;
create alias DBMS_ALERT_SIGNAL as $$
Integer dbmsAlertSignal(Integer out , String name, String message) throws Exception {
    return new Integer(0);
}
$$;

But the call fails because the data access layer says

No data is available [2000-189]

I tried to return a SimpleResultSet instead of Integer but then it fails on calling the function.

Aucun commentaire:

Enregistrer un commentaire