Forum Stats

  • 3,734,396 Users
  • 2,246,961 Discussions
  • 7,857,255 Comments

Discussions

SQLcl Version 19.4.0.354.1736 format rules works for FORMAT BUFFER and doesn't work for FORMAT FILE

User800507-Oracle
User800507-Oracle Member Posts: 23 Employee
edited Mar 5, 2020 1:08PM in SQLcl

A very simple format rule

<options>

<breaksComma>oracle.dbtools.app.Format.Breaks.Before</breaksComma>

</options>

works for format buffer but doesn't work for format file.

Download attached test.zip, unzip it and than run

sql.exe any_user/password @test.run

and you will see that format buffer works fine while format file works with default rules.

Answers

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,776 Bronze Crown
    edited Feb 20, 2020 1:35AM

    Likely "format buffer" is using a different format rules file than when you run what ever is in that other "script"...

  • User800507-Oracle
    User800507-Oracle Member Posts: 23 Employee
    edited Feb 20, 2020 2:06AM

    In previous versions of SQLcl both formatting methods produced the same output.

  • user9944749
    user9944749 Member Posts: 8
    edited Mar 5, 2020 1:08PM

    Hi
    i am running into similar issue where even after reloading new RULES using FORMAT RULES and using FORMAT FILE option
    i am not seeing the changes (  CASE changes for both id and keywords to lowercase to be specific )

    Below is the rules xml i am using in sqlcl 19.4

    Thanks in advance

    <options><adjustCaseOnly>false</adjustCaseOnly>

    <alignTabColAliases>true</alignTabColAliases>

    <breakOnSubqueries>true</breakOnSubqueries>

    <alignEquality>false</alignEquality>

    <singleLineComments>oracle.dbtools.app.Format.InlineComments.CommentsUnchanged</singleLineComments>

    <breakAnsiiJoin>false</breakAnsiiJoin>

    <maxCharLineSize>128</maxCharLineSize>

    <alignAssignments>false</alignAssignments>

    <breaksProcArgs>false</breaksProcArgs>

    <alignRight>false</alignRight>

    <breaksComma>oracle.dbtools.app.Format.Breaks.After</breaksComma>

    <breaksAroundLogicalConjunctions>oracle.dbtools.app.Format.Breaks.Before</breaksAroundLogicalConjunctions>

    <alignNamedArgs>true</alignNamedArgs>

    <formatProgramURL>default</formatProgramURL>

    <formatThreshold>1</formatThreshold>

    <spaceAroundOperators>true</spaceAroundOperators>

    <useTab>false</useTab>

    <idCase>oracle.dbtools.app.Format.Case.lower</idCase>

    <extraLinesAfterSignificantStatements>oracle.dbtools.app.Format.BreaksX2.X2</extraLinesAfterSignificantStatements>

    <breaksConcat>oracle.dbtools.app.Format.Breaks.Before</breaksConcat>

    <spaceAroundBrackets>oracle.dbtools.app.Format.Space.Default</spaceAroundBrackets>

    <flowControl>oracle.dbtools.app.Format.FlowControl.IndentedActions</flowControl>

    <commasPerLine>5</commasPerLine>

    <forceLinebreaksBeforeComment>false</forceLinebreaksBeforeComment>

    <alignTypeDecl>true</alignTypeDecl>

    <breakParenCondition>false</breakParenCondition>

    <identSpaces>4</identSpaces>

    <breaksAfterSelect>false</breaksAfterSelect>

    <spaceAfterCommas>true</spaceAfterCommas>

    <kwCase>oracle.dbtools.app.Format.Case.lower</kwCase>

    </options>

Sign In or Register to comment.