Originally posted by: jvanboga
Actually, the map in question is reading an external file, mapping it to a flat file with an internal format. That file is loaded to multiple tables by another map. So the date in question is additional data taken from a production table to assist in later processing. Here is the DBSelect with a hard coded value...
DBLOOKUP("SELECT INS_DATE FROM X_TABLE_1 WHERE COL_1 || COL_2 || COL_7 || COL_8 = '123456XYZ789ABC'", "-mdq x_tables.mdq -dn cus -trace trace_file.dbl" ))
Here is an extract from the lookup's trace file....
<7984-4896>: SELECT INS_DATE FROM X_TABLE_1 WHERE COL_1 || COL_2 || COL_7 || COL_8 = '123456XYZ789ABC'
<7984-4896>: Statement execution succeeded.
<7984-4896>: The columns are of the following types:
<7984-4896>: Column 1 (INS_DATE) type is DATE.
<7984-4896>: Number of buffers in fetch array = 3276
<7984-4896>: Writing results to a buffer.
<7984-4896>: Retrieved 1 records (21 bytes).
<7984-4896>: Returned status: (0) Success
The INS_DATE value returned is '2008-12-30 13:11:44'.
The element/field it is written to is defines as Date&Time {CCYY-MM-DD} [ {HH24
:MM:SS]}
The problem is that the query returns the date and time as text. So, amongst other ways, the most logical thing for me to do was to wrap the query in rule todatetime(dbselect(....), "{CCYY-MM-DD} [ {HH24
:MM:SS]}"). When doing this the output field is populated with null. I also tried defining the date/time as "{CCYY-MM-DD} {HH24:MM:SS}" and "CCYY-MM-DD HH24:MM:SS" and "CCYY-MM-DD HH:MM:SS" but the effect is the same.
#IBM-Websphere-Transformation-Extender#DataExchange#IBMSterlingTransformationExtender