Forum Stats

  • 3,741,285 Users
  • 2,248,404 Discussions
  • 7,861,719 Comments

Discussions

New version 18.2, new format bugs :-(

User800507-Oracle
User800507-Oracle Member Posts: 23 Employee
edited Aug 13, 2018 2:18PM in SQLcl

I've uploaded the fresh new version of sqlcl 18.2 and tried to format very simple SQL that was formatted without problems in 18.1

I used a copy of rules file that I used for 18.1 (attached)

When I run the following script on the second format buffer  I got a sqlcl crash

spool bug18_2

SELECT ROWID AS RD FROM MIGR_BATCH_HISTORIES WHERE BATCH_BATCH_ID = :B1 AND START_DATE <= SYSDATE AND END_DATE >= SYSDATE;

format buffer

format rules format_rules_18_2_1.xml

format buffer

spool off

Exception in thread "main" Syntax Error at line 347, column 32
| [node) from_clause & [node^+8 < node^)
                                ^^^Expected: ')','^','-','+',
        at oracle.dbtools.parser.plsql.SyntaxError.checkSyntax(SyntaxError.java:164)
        at oracle.dbtools.parser.plsql.SyntaxError.checkSyntax(SyntaxError.java:101)
        at oracle.dbtools.parser.Parsed.getRoot(Parsed.java:111)
        at oracle.dbtools.parser.Parsed.getSyntaxError(Parsed.java:120)
        at oracle.dbtools.arbori.Program.compile(Program.java:254)
        at oracle.dbtools.arbori.SqlProgram.<init>(SqlProgram.java:26)
        at oracle.dbtools.app.Format$3.<init>(Format.java:258)
        at oracle.dbtools.app.Format.format(Format.java:258)
        at oracle.dbtools.raptor.newscriptrunner.commands.FormatSQLPlusCommand.handleEvent(FormatSQLPlusCommand.java:65)        at oracle.dbtools.raptor.newscriptrunner.CommandRegistry.fireListeners(CommandRegistry.java:427)
        at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.run(ScriptRunner.java:224)
        at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:341)
        at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:224)
        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.runFile(SqlCli.java:786)
        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.handleAtFiles(SqlCli.java:764)
        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:486)

Have you any regression tests for formatting?

Answers

  • 3761118
    3761118 Member Posts: 2
    edited Aug 13, 2018 12:32PM

    Hi,

    I am also trying to get a format for a file using

    >format file input_file output_file

    SQLcl works for correct syntax of the input_file

    for incorrect syntax of the input_file it just says "parser error" and outputs the usuage of the format command.

    Is there a way to get the actual linenumber where the error was found,

    Please let me know

    Thanks

  • Vadim Tropashko-Oracle
    Vadim Tropashko-Oracle Posts: 1,233 Employee
    edited Aug 13, 2018 2:18PM

    The culprit is the folowing:

    <formatProgramURL>/C:/Users/smosin/AppData/Roaming/SQL Developer/system17.4.0.355.2349/o.sqldeveloper/format.arbori</formatProgramURL>

    Removing it should fix the error message (the default custom formatting program would be fetched, but the advanced format options would be taken from your modified xml file).

Sign In or Register to comment.