Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Actuate 9 Information Object Designer Concern
IBMer
I am working on the Information Object Designer Version: 9 Service Pack 1 (Build 90D061218).
I was trying to use the time datatype column in IOD thus, I have added this section of code in the mappings.xml file.
<DataType Name="time" GenericSQLType="TIMESTAMP">
<Aliases>
<Alias>TIMESTMP</Alias>
</Aliases>
</DataType>
But this code leads to show the time let say 12:00:00 in the timestamp format ie 12/17/2008 12:00:00. So for doing the casting for the same I have added another piece of code in the mappings.xml file.
<FunctionMapping FunctionName="CAST_AS_VARCHAR"
OperandTypes="TIMESTAMP INTEGER"
FromType="TIME" ToType="VARCHAR">
( CHAR( TIME($P0), JIS ) )
</FunctionMapping>
In this section of code I am casting the column to varchar and after that I am applying the left and right function for truncating the same.
Left(Cast(VTGNSX00_GNS_CHRGBK_RPT.NET_PROC_DT AS VARCHAR(30)),10) as asd,
Left(Right(Cast(VTGNSX00_GNS_CHRGBK_RPT.NET_PROC_TM AS VARCHAR(30)),12),8) AS NET_PROC_TM
Now the problem I am facing is because of this casting to varchar I have to input the date as 2008-11-01 which is not acceptable by the Client.
Is there functionality available for casting to date and time? So that I can cast it directly to 12/17/2008 for date and 00:00:00 for time
Or What piece of code should be added to get the casting done?
I tried with his code:
<FunctionMapping FunctionName="CAST_AS_DATE"
FromType="DATE" ToType="TIMESTAMP">
TIMESTAMP( $P0 )
</FunctionMapping>
But it shows an error as to function CAST_AS_DATE FromTYPE=:DATE ToType=:TIMESTAM<p is not recognized.
What changes to be done to get this functionality.
Can anyone please provide me the solution as to this issue is creating backlog for the project.
Thanks in advance.
Find more posts tagged with
Comments
viyer
If you look at the end of the "mappings.xml" file under $iServer/etc/data_integration/DB2 directory it has a section called "Db2WithTimeMapper." This mapper derives from BaseDb2Mapper and supports the "time" data type. If you change the entry in $iServer/etc/intsrvrsources.xml file for DB2_9 from "BaseDb2Mapper" to "Db2WithTimeMapper" it should work.
Try it out.