Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009

    Unanswered: Oracle formatter

    Hi All,

    I am using code formatter to format my code however I want to have a certain format with my select and from statement that the formatter cannot do.

    I want my code to be like this when I format

    select col1,
    (select col1 from table1)col2,
    (select col1 from table2)col3,
    (select col1 from table3)col4
    from table1

    however when I format it will become:

    select col1,
    (select col1
    from table1)col2,
    (select col1
    from table2)col3,
    (select col1
    from table3)col4
    from table1

    all the from statement is in the nextline after its select

    Is there a way I can set the formatter?


  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    SELECT col1, 
           (SELECT col1 
            FROM   table1) col2, 
           (SELECT col1 
            FROM   table2) col3, 
           (SELECT col1 
            FROM   table3) col4 
    FROM   table1
    >I am using code formatter
    >Is there a way I can set the formatter?
    So you expect us to consult our crystal ball or OUIJA board to grok which formatter you are abusing
    & know how to automagically provide setting changes to mangle the code better.
    Sorry, but I'm out of pixie dust & can't solve this mystery now
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Feb 2005
    How would the formatter know when to use newline and when not to? In your example the final FROM statement is on a newline!! Your formatter is using the standard formatting (apart from indentation) that most programmers use.

  4. #4
    Join Date
    Sep 2002
    Provided Answers: 1
    Serious question: why are you relying on a code formatting tool to format your own code? The only time formatting tools are potentially useful (IMHO) is when you are trying to read someone else's badly formatted code - and even then, I often find that the process of reformatting the code manually helps me gain an insight into what it is supposed to be doing. And I've never found a code formatter that formats code the way I like it - well, except the Fortran code formatter I wrote myself about 100 years ago, again to re-format other people's lousy code!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts