Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. oracle not allow date field with same name "Date"

oracle not allow date field with same name "Date"

Scheduled Pinned Locked Moved Database
databasesql-serveroraclesysadmin
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asif Rehman
    wrote on last edited by
    #1

    I'm moving my sql server db to oracle. But oracle seems not to support Date Name with date data type. Looking for solution as changing name from Date to Vdate or bDate requires lot of changes in app code.

    G J S 3 Replies Last reply
    0
    • A Asif Rehman

      I'm moving my sql server db to oracle. But oracle seems not to support Date Name with date data type. Looking for solution as changing name from Date to Vdate or bDate requires lot of changes in app code.

      G Offline
      G Offline
      GuyThiebaut
      wrote on last edited by
      #2

      "Date" will probably be a reserved word which is why you get this issue. Outside of changing the column name,which I strongly recommend doing(calling a column "date" is asking for trouble), which will involve quite a bit of work, the only workaround is to use whatever Oracle uses to delimit column names ([],"" etc) My experience is that it is best to fix these sorts of issues early i.e. rename the column as the problems you currently experience will be magnified in a few months time when you have more that depends on a column called "date". The amount of work it will take you to fix this issue now will be far less than later.

      “That which can be asserted without evidence, can be dismissed without evidence.”

      ― Christopher Hitchens

      1 Reply Last reply
      0
      • A Asif Rehman

        I'm moving my sql server db to oracle. But oracle seems not to support Date Name with date data type. Looking for solution as changing name from Date to Vdate or bDate requires lot of changes in app code.

        J Offline
        J Offline
        Jorgen Andersson
        wrote on last edited by
        #3

        Guy is spot on on all accounts, Date isn't just a reserved word in Oracle but also by ANSI, you have a list here. As a delimiter in Oracle you use the ANSI standard "". But also here I agree with Guy, don't do it, it'll save you a lot of trouble later.

        Wrong is evil and must be defeated. - Jeff Ello

        1 Reply Last reply
        0
        • A Asif Rehman

          I'm moving my sql server db to oracle. But oracle seems not to support Date Name with date data type. Looking for solution as changing name from Date to Vdate or bDate requires lot of changes in app code.

          S Offline
          S Offline
          Sascha Lefevre
          wrote on last edited by
          #4

          Another benefit of changing the column name will be the opportunity to give it a semantically meaningful name. Just "Date" could be any sort of date anyone might ever think of. Calling it what it actually is (like "CreatedDate", "PurchaseDate", etc.) will make much more sense.

          If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups