简体   繁体   中英

Oracle SQL Time/date always a String?

I'll preface this as I code primarily in Python and work with analytical tools; Alteryx, Tableau, Spotfire and a few others.

I've been tasked with modernizing some old etl and reporting routines was given several reports that were created in 2006. Needs updating, removing the Java functions, and pushing to the cloud. The SQL was definitely a trial, whoever thought aliasing everything with single letter assignments should be shot.

Complaints aside, my actual question is:::

Every "Date/Time" column is set to a string. Everyone of them. Then every SQL query I have been given to modify/update uses cast to convert to a date time and then does the pull by sysdate() -X In fact almost the entirety of the Oracle DBs that I am touching almost all their data types, say 90%, are just string.

I'm fairly new to SQL and admittedly getting used to it. Is this normal?

It depends. It's not something I would usually see where I work. The problem is, I don't know what the requirements are. Maybe there was a reason to design the data model that way. You'll need to see how the data is being used. If you change one of those strings to a date, will it break something downstream?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM