Solved

MS SQL DTS - Oracle Dates error out on import into MS SQL table

Posted on 2004-10-06
6
574 Views
Last Modified: 2008-02-01
I am using MS SQL DTS to stage Oracle data to an MS SQL data store. MS SQL does not like the Oracle dates. Currently I have just changed the MS SQL data columns to a varchar field type. I would like instead to convert the date so that it can be imported into the datetime field. I have heard that there is an Oracle equivilant to the MS SQL CAST function. Anybody have any ideas on how to do this transformation? Just a note, it is not a driver issue, the same drivers have no problem with the Oracle dates when I link them in an access data base.
0
Comment
Question by:EVANFAGER
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
JaffaKREE earned 250 total points
ID: 12241450
0
 
LVL 6

Assisted Solution

by:RaisinJ
RaisinJ earned 250 total points
ID: 12241958
Try this...  You can also convert Date values in Oracle using the TO_CHAR, eg. TO_CHAR(@DATE, 'YYYY/MM/DD HH24:MM:SS'), function and TO_DATE, eg. to_date('1998/05/31:12:00:00AM', 'yyyy/mm/dd:hh:mi:ssam'), function.  The web page below goes over these functions and DATE formats you can use.  

Also, SQL Server has date limits where Oracle doesn't.  SQL Server cannot except dates less than January 1, 1753 and greater than December 31, 9999.  Oracle can, so make sure you don't accidently have any date values inside you Oracle DB which are beyond the range of SQL Server.

http://www-db.stanford.edu/~ullman/fcdb/oracle/or-time.html


0
 
LVL 6

Expert Comment

by:RaisinJ
ID: 12435185
I am all set thanks...  Hopefully my statements above gave some insite.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now