SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL: Quotes around the values of numeric columns?

    Hello,

    I must modify an application build with MySQL to make it work with other databases.

    This application works perfectly but use quotes in all the requests even for numeric columns.

    For example:
    SELECT * FROM table WHERE id='1'

    (where id is declared as INTEGER)

    Do you know if this syntax is accepted by all databases?

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,017
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    yes i do, and no it isn't

    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you please mention the databases you are familiar with that don't support it?

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,017
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    mysql and sql server support it (with implicit conversion)

    microsoft access doesn't

    i can't test any others at the moment
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks,

    I'm getting a lot of confirmations

    It works with MySQL, Oracle, PostgreSQL, SQLite and SQL Server

    Any additional information about other databases
    accepting or not this syntax is still welcome. Thanks


Bookmarks

Posting Permissions

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