1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Rep Power

    Question SQL Data Case Sensitivity

    I switch a lot between Oracle 11g Database, MS SQL Server, and PostgreSQL. I was wondering if there's a specified or preferred way to syntax data entered in. I read in my Oracle book that all SQL data should be entered in UPPERCASE format and to standardize on this. I'm not sure if this is up to the DBA to select how the data is entered in the system but I figured I would ask this basic elementary question. All my data in Oracle 11g is UPPERCASE but my data in PostgreSQL is in lowercase.

    Thanks for any info.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Rep Power
    Really? All data is entered in upper case? Even Names, Streets, Cities?

    Or are you talking about object names (tables, columns, views, ...) ?

    If the latter, then simply enter it as you wish, just make sure you don't use quoted identifiers and you should be fine.

    If nothing is quoted, then SELECT * FROM FOO is the same as select * from foo because SQL is case-insensitive.

    However SQL Server chooses not to always respect that. Whether or not object names are case-sensitive depends on the collation of the database. So for SQL Server my above example is not always true.
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.

    Tips on how to ask better questions:
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Rep Power
    I use it as a best practice that ALWAYS database "field names" are returned uppercase, no matter how they are saved in the database.

    I used this first time due to Oracle project 5 years ago and found it good also for mysql and pgsql.

    Now it depends on your database interface, plugin or whatever to be able to return your dataset as "uppercase".

IMN logo majestic logo threadwatch logo seochat tools logo