https://github.com/oracle/oracle-db-tools/blob/0ba494dc82cbb555235d15f1a2b08b2508aefd92/sqlcl/java/src/RunMyScript.java#L44C5-L44C56
We should not patch the result of execution by deleting some text because we don't know if this a real text generated by script or an artefact of ScriptRunnerContext class. To suppress the force_print text at the and of each command execution report it is much better to do the following:
ctx.putProperty('script.runner.using.systemout', True)
I propose to add this line just after creation of context
ScriptRunnerContext ctx = new ScriptRunnerContext();
ctx.setBaseConnection(conn);
ctx.putProperty('script.runner.using.systemout', Boolean.TRUE); /// <--- here
and remove line
results = results.replaceAll(" force_print\n", "");
This change should be applied to both sqlcl/java/src/ParseScriptRunOneAtATime.java and sqlcl/java/src/RunMyScript.java examples.
https://github.com/oracle/oracle-db-tools/blob/0ba494dc82cbb555235d15f1a2b08b2508aefd92/sqlcl/java/src/RunMyScript.java#L44C5-L44C56
We should not patch the result of execution by deleting some text because we don't know if this a real text generated by script or an artefact of ScriptRunnerContext class. To suppress the
force_printtext at the and of each command execution report it is much better to do the following:I propose to add this line just after creation of context
and remove line
This change should be applied to both
sqlcl/java/src/ParseScriptRunOneAtATime.javaandsqlcl/java/src/RunMyScript.javaexamples.