I am working on an EDW that is using SSIS to bring in SalesForce tables. I'm in the process of writing a validation query on the CData Salesforce Source that will return CURRENT_DATEIME() for when it was loaded as well as Sum of the Column values, in order to use later in my validation strategy. I have the results of these column importing into a source validation table in SSMS. The problem I am running into is CData is defaulting the columns to STRING datatypes when I need NUMERIC on both, but you cannot Parse, Convert or Cast in a SOQL query, apparently. What would be the best way to convert these?
Here is my Query thus Far.....
SELECT TABLE_NAME, SOURCE_COLUMN_VALUE, COLUMN_NUMBER, LOAD_DATE, LOAD_DATETIME
FROM (
SELECT 'TABLE' AS TABLE_NAME, COUNT(*) AS SOURCE_COLUMN_VALUE, 0 AS
COLUMN_NUMBER, CURRENT_DATE() AS LOAD_DATE, CURRENT_TIMESTAMP() AS
LOAD_DATETIME
FROM [TABLE] UNION ALL
SELECT 'TABLE' AS TABLE_NAME, SUM(CASE WHEN Id IS NULL THEN 0 ELSE 1
END) AS SOURCE_COLUMN_VALUE, 1 AS COLUMN_NUMBER, CURRENT_DATE() AS
LOAD_DATE,CURRENT_TIMESTAMP() AS LOAD_DATETIME FROM [TABLE]
)
I need to convert the selected columns SOURCE_COLUMN_VALUE and LOAD_DATETIME to NUMERIC using SOQL.
I have tried TO_NUMBER() and NUMERIC.PARSE() already
This is the error I keep getting
Error: 0xC020901C at BASS_USER_VALIDATION, OLE DB Destination [29]: There was an error with OLE DB Destination.Inputs[OLE DB Destination Input].Columns[LOAD_DATE] on OLE DB Destination.Inputs[OLE DB Destination Input]. The column status returned was: "The value could not be converted because of a potential loss of data.".
Error: 0xC0209029 at BASS_USER_VALIDATION, OLE DB Destination [29]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "OLE DB Destination.Inputs[OLE DB Destination Input]" failed because error code 0xC0209077 occurred, and the error row disposition on "OLE DB Destination.Inputs[OLE DB Destination Input]" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
Error: 0xC0047022 at BASS_USER_VALIDATION, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "OLE DB Destination" (29) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (42). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.