How do you call a utAssert statement against a procedure that contains an out parameter? I have the following:
PROCEDURE ut_cashrelease_wrong_date IS
last_datetime DATE;
last_datetime2 DATE;
BEGIN
SELECT SYSDATE - INTERVAL '1' SECOND INTO last_datetime from dual;
SELECT SYSDATE - INTERVAL '1' SECOND INTO last_datetime2 from dual;
This calls a proc with this syntax:
PROCEDURE pr_get_test2 (
p_business_datetime IN t_fund_curr_stat_mst.upd_t%TYPE,
p_business_datetime2 OUT t_fund_curr_stat_mst.upd_t%TYPE
);
However, I'm getting the following error:
PLS-00201: identifier 'LAST_DATETIME2' must be declared
last_datetime2 is declared in the test, but I'm passing a string with this name. I don't want a value passed since it's an out parameter.
In actuality, since I'm expecting to hit an exception, I really don't care what gets passed in, but I need to call the proc with that signature.
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How do you call a utAssert statement against a procedure that contains an out parameter? I have the following:
PROCEDURE ut_cashrelease_wrong_date IS
last_datetime DATE;
last_datetime2 DATE;
BEGIN
SELECT SYSDATE - INTERVAL '1' SECOND INTO last_datetime from dual;
SELECT SYSDATE - INTERVAL '1' SECOND INTO last_datetime2 from dual;
utAssert.throws('wrong date',
'PKG_WEBSERVICES.pr_get_test2(''' || last_datetime || ''',last_datetime2);',
-20104
);
END;
This calls a proc with this syntax:
PROCEDURE pr_get_test2 (
p_business_datetime IN t_fund_curr_stat_mst.upd_t%TYPE,
p_business_datetime2 OUT t_fund_curr_stat_mst.upd_t%TYPE
);
However, I'm getting the following error:
PLS-00201: identifier 'LAST_DATETIME2' must be declared
last_datetime2 is declared in the test, but I'm passing a string with this name. I don't want a value passed since it's an out parameter.
In actuality, since I'm expecting to hit an exception, I really don't care what gets passed in, but I need to call the proc with that signature.
Thanks.
I was able to get this working by using this:
utAssert.throws('wrong date',
'declare last_datetime2 DATE;
begin
PKG_WEBSERVICES.pr_get_cashrelease(''' || last_datetime || ''',last_datetime2);
end;',
-20104
);