oracle not allow date field with same name "Date"
-
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.
-
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.
"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
-
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.
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
-
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.
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