Forum Stats

  • 3,758,206 Users
  • 2,251,354 Discussions
  • 7,870,108 Comments

Discussions

SQLCL format command error

Arnost Klaska
Arnost Klaska Member Posts: 29 Blue Ribbon
edited Apr 11, 2018 2:46AM in SQLcl

Hi,

downloaded new version of SQLDeveloper 18.1. Trying to format sql file with SQLDeveloper format settings but Failed to read custom formatting program error reported:

[email protected]:~/HCI_projects/Cart$ /opt/sqldeveloper/sqldeveloper/bin/sql /nolog

SQLcl: Release 18.1 Production on Sat Apr 07 19:48:27 2018

Copyright (c) 1982, 2018, Oracle.  All rights reserved.

SQL> format rules formater.xml

Formatter rules loaded

SQL> format file TABLES.sql TABS.sql

Failed to read custom formatting program /home/klaska/.sqldeveloper/system18.1.0.095.1630/o.sqldeveloper/format.arbori

/home/klaska/.sqldeveloper/system18.1.0.095.1630/o.sqldeveloper/format.arbori (No such file or directory)

Found this file in old version directory only

SQL> [email protected]:~/HCI_projects/Cart$ find ~/.sqldeveloper/ -type f -name format.arbori

/home/klaska/.sqldeveloper/system17.4.1.054.0712/o.sqldeveloper/format.arbori

Any clues?

Best Answer

Answers

  • Glen Conway
    Glen Conway Member Posts: 859 Gold Badge
    edited Apr 7, 2018 4:26PM

    It sounds like the user settings migration step during the initial run of SQL Developer 18.1 did not pick up the format.arbori file, or perhaps you skipped migrating the settings from 17.4?

    As a workaround, try copying it from system17.4.1.054.0712/o.sqldeveloper to system18.1.0.095.1630/o.sqldeveloper

    Edit: Or to avoid a manual workaround, try exporting from 17.4 using the Code Editor preferences

             Format -> Advance Format-> Custom Format

          then import into 18.1

     

  • Arnost Klaska
    Arnost Klaska Member Posts: 29 Blue Ribbon
    edited Apr 9, 2018 2:30AM

    Hi,

    format.arbori file is created in correct directory by opening Custom Format dialog in preferences. There is no need to migrate preferences or manual copy.

    Arnost

  • Glen Conway
    Glen Conway Member Posts: 859 Gold Badge
    edited Apr 9, 2018 7:11PM

    Good, it makes perfect sense that opening the Custom Format dialog creates the format.arbori file.  It also makes sense that most users would want format.arbori to be migrated to newer SQL Developer versions via the standard migrate user settings process.

    If that does not happen, then it is probably an oversight on the part of the developer.

  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 7,980 Employee
    edited Apr 10, 2018 1:23PM Accepted Answer

    Confirmed as bug, when I tried it, it was formatting the code the way I wanted it to, I just also got the missing abori xml file error message.

    Arnost Klaska