#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    56
    Rep Power
    3

    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
    Location
    Germany
    Posts
    2,781
    Rep Power
    348
    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.
    http://forums.devshed.com/misc.php?do=bbcode#code

    Tips on how to ask better questions:
    http://tkyte.blogspot.de/2005/06/how-to-ask-questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0
    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