August 31, 2004 at 9:44 am
I'm trying to write an Active X Transformation script to convert a 4 part date stored in seperate columns as cen,year,month, day. I've got the script for the most part but want to make it more robust to account for invalid dates either out of range or with nulls. I've never done a multi - phase data pump but figured it would be able to handle the bad dates. I guess it still counts as an error even through the transform failure subphase should catch the error and insert the min date value (which represents Invalid Date in my world). I know I'm envoking the TransFailureMain Function, but somehow the transformation still returns errors. I prefer not to ignore errors as I'm also bringing across about 50 additional columns in the same transformation in 4 individual copy column tasks (somewhere I read if you use increments of 15 for number of columns in a copy column it improves performance, but that's a side note).
Does anyone have any alternative suggestions for approaching my initial problem?
Here is the error I get.
Here is my code
' Copy each source column to the destination column Function Main() Dim Date Dim Day Dim Month Dim Year Dim Century Day = Cint(DTSSource("J2_CHANGEDAY") ) Month = 100 * Cint( DTSSource("J2_CHANGEMONTH") ) Year = 10000 * Cint( DTSSource("J2_CHANGEYEAR") ) Century = 1000000 * Cint( DTSSource("J2_CHANGECENTURY") ) Date = Century + Year + Month + Day
DTSDestination("J2_CHANGEDATE") = (Cstr(Date)) Main = DTSTransformStat_OK
End Function
Function TransFailureMain() DTSDestination("J2_CHANGEDATE") = "1753/01/01" TransFailureMain() = DTSTransformStat_OK End Function
Function InsertSuccessMain() InsertSuccessMain = DTSTransformstat_OK End Function
Function InsertFailureMain() DTSDestination("J2_CHANGEDATE") = "1753/01/01" InsertFailureMain = DTSTransformstat_OK End Function
'
Thanks to any who read and respond!!!
August 31, 2004 at 10:07 am
Just found my problem, the parenthesis below. If anyone has a better approach to the problem still I'm up for suggestions.
Function TransFailureMain() DTSDestination("J2_CHANGEDATE") = "1753/01/01" TransFailureMain() = DTSTransformStat_OK End Function
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply