3 Replies Latest reply on Mar 5, 2020 6:08 PM by user9944749

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

    User800507-Oracle

      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.

        • 1. Re: SQLcl Version 19.4.0.354.1736 format rules works for FORMAT BUFFER and doesn't work for FORMAT FILE
          Gaz in Oz

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

          • 2. Re: SQLcl Version 19.4.0.354.1736 format rules works for FORMAT BUFFER and doesn't work for FORMAT FILE
            User800507-Oracle

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

            • 3. Re: SQLcl Version 19.4.0.354.1736 format rules works for FORMAT BUFFER and doesn't work for FORMAT FILE
              user9944749

              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>