Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a39d748

Browse files
author
Jacek Gębal
committed
Changed Reporter initialization to use UT_OUTPUT_REPORTER_BASE instead of UT_REPORTER_BASE.
Oracle JDBC 23.x sends the reporter STRUCT typed as UT_OUTPUT_REPORTER_BASE. Assigning UT_OUTPUT_REPORTER_BASE to a concrete subtype variable fails with PLS-00382
1 parent a574cee commit a39d748

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/main/java/org/utplsql/api/outputBuffer/DefaultOutputBuffer.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ class DefaultOutputBuffer extends AbstractOutputBuffer {
2727

2828
@Override
2929
protected CallableStatement getLinesCursorStatement(Connection conn) throws SQLException {
30-
String plsql = "DECLARE l_rep ut_output_reporter_base; "
31-
+ "BEGIN l_rep := :2; :1 := l_rep.get_lines_cursor(); END;";
30+
Reporter reporter = getReporter();
31+
String plsql = "DECLARE" +
32+
" l_rep " + reporter.getTypeName() + "; " +
33+
"BEGIN" +
34+
" l_rep := treat(:2 as " + reporter.getTypeName() + ");" +
35+
" :1 := l_rep.get_lines_cursor(); " +
36+
"END;";
3237
OracleCallableStatement cstmt = (OracleCallableStatement) conn.prepareCall(plsql);
3338
cstmt.registerOutParameter(1, OracleTypes.CURSOR);
34-
cstmt.setORAData(2, getReporter());
39+
cstmt.setORAData(2, reporter);
3540
return cstmt;
3641
}
3742
}

0 commit comments

Comments
 (0)