You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create or replace PACKAGE ut_sample_test IS
--%suite(Sample Test Suite)
--%tags(suite1)
--%test(Compare Ref Cursors)
--%tags(test1)
PROCEDURE ut_refcursors1;
END ut_sample_test;
/
create or replace PACKAGE BODY ut_sample_test IS
PROCEDURE ut_refcursors1 IS
v_actual SYS_REFCURSOR;
v_expected SYS_REFCURSOR;
BEGIN
open v_expected for select 12345 as test from dual;
open v_actual for select 12345 as test from dual;
ut.expect(v_actual).to_equal(v_expected);
END;
END ut_sample_test;
/
it fails with ORA-01438: value larger than specified precision allowed for this column ORA-06512: at "UT3.UT_DATA_VALUE_REFCURSOR", line 332 ORA-06512: at "UT3.UT_DATA_VALUE_REFCURSOR", line 380 ORA-06512: at "UT3.UT_EQUAL", line 225 ORA-06512: at "UT3.UT_EXPECTATION", line 26 ORA-06512: at "UT3.UT_EXPECTATION", line 138 ORA-06512: at "UT3.UT_SAMPLE_TEST", line 10
This is due to ut_compound_helper.generate_xmltab_stmt and dbms_sql.describe_columns3 for some reason it set max column len to 4 , precision to 0 and scale to -127 when selecting from dual.
Solution is if the type is NUMBER then use a precision and scale instead of max_col_len.
The text was updated successfully, but these errors were encountered:
In this scenario I think issue is with dbms package as showing precision as zero where allowed is 1..38 we should check if precision is positive and apply then otherwise type mark as number with no precision and scale
When running a tests like this
it fails with
ORA-01438: value larger than specified precision allowed for this column ORA-06512: at "UT3.UT_DATA_VALUE_REFCURSOR", line 332 ORA-06512: at "UT3.UT_DATA_VALUE_REFCURSOR", line 380 ORA-06512: at "UT3.UT_EQUAL", line 225 ORA-06512: at "UT3.UT_EXPECTATION", line 26 ORA-06512: at "UT3.UT_EXPECTATION", line 138 ORA-06512: at "UT3.UT_SAMPLE_TEST", line 10
This is due to
ut_compound_helper.generate_xmltab_stmt
anddbms_sql.describe_columns3
for some reason it set max column len to 4 , precision to 0 and scale to -127 when selecting from dual.Solution is if the type is NUMBER then use a precision and scale instead of max_col_len.
The text was updated successfully, but these errors were encountered: