Skip to content

suppress force_print text #51

@nmaqsudov

Description

@nmaqsudov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions