Formatting vs Changing Code as You Type

thatjeffsmith SQL Developer 8 Comments

Tell Others About This Story:

Reviewing my timeline, I came across this gem from Franc.

Franck isn’t alone – a lot of people hate it when their code doesn’t look the way they want it to.

Many folks know about our formatter, and how to use it to get their IDENTIFIERS UPPER-CASED.

But did you know you can have SQL Developer change the case of your code as you type it?

Here’s a 10 minute video where I show how to setup the formatter and the other code editor preferences to get your code, the way you want it.

The Video Demo

Related Posts Plugin for WordPress, Blogger...
Tell Others About This Story:

Comments 8

  1. Why do I get different results when I format a block of text, as opposed to writing a line of code and hitting enter to go to a new line? It seems that my settings should be universal over these two methods of operation?
    john3

    1. thatjeffsmith Post
      Author
  2. Any way to get boolean connectors under “where”s to indent?

    where
    IDX.TABLE_OWNER = ‘TABLE_OWNER’
    and IDX.OWNER = SEG.OWNER
    and IDX.INDEX_NAME = SEG.SEGMENT_NAME
    group by
    IDX.INDEX_NAME,
    IDX.INDEX_TYPE

    1. dang it, the indents were removed in my sample.

      After formatting in SQL Developer, the first predicate after the WHERE is indented, but subsequent ones (with AND or OR) are not. Would be nice if they would all line up below the first one.

    2. thatjeffsmith Post
      Author
  3. Since when is anything case sensitive in ORACLE SQL?

    Keywords are completely case insensitive, and all identifiers are automatically UPPER CASED unless they are surrounded by double quotes. When creating code, it is important to be able to easily differentiate between keywords and identifiers. Most formatters that do that differentiation allow either for keywords to be all upper case, and identifiers to be all lower case, or vice versa.

    Identifiers have the potential to be case sensitive, but any coder who takes advantage of that possibility, is not someone that I would want creating code for me.

    1. thatjeffsmith Post
      Author

      That’s not what this post is about. Feel free to talk to Franck about it – click on the picture/twitter link. The conversation went on awhile and touched on what you’re talking about.

      I hate case sensitive object names in the database, for what it’s worth.

Leave a Reply

Your email address will not be published. Required fields are marked *