I have used the below lua script for getting date only :
function cm_transform()
local oldvalue=optim.source.getcolumnvalue("INIT_OPENING_DT")
function convertDate(vardate)
local d,m,y = string.match(vardate, '(%d+)/(%d+)/(%d+)')
return string.format('%s/%s/%s', y,m,d)
end
if oldvalue == nil
then newvalue = ""
else
newvalue= convertDate(oldvalue)
value=os.date("%X",newvalue)
end
print("New Value: "..newvalue)
optim.target.setcolumnvalue(newvalue)
end
While printing we are getting date only field. While inserting it to target field using :optim.target.setcolumnvalue(newvalue)", it is showing value as <Error> in the target field. Please help to resolve
------------------------------
Monisha M
------------------------------
Original Message:
Sent: Fri December 20, 2024 02:03 AM
From: HOW MING (Felix) YONG
Subject: Date fields in compare file has timestamp also along with date but in actual database the data field has only dates.
Hi
Can you change the Data Type in the Oracle Connector to DATE instead of TIMESTAMP?
You can use Modify/Transformer Stage to make the changes you need if the above don't work.
------------------------------
HOW MING (Felix) YONG
Senior Data & AI Technical Specialist - Information Architecture
IBM
Melbourne
Original Message:
Sent: Thu December 19, 2024 12:59 AM
From: Monisha M
Subject: Date fields in compare file has timestamp also along with date but in actual database the data field has only dates.
Date fields in compare file has timestamp also along with date but in actual database the data field has only dates.
So causing mismatch in the compare file.
While extracting itself it is showing timestamp instead of date alone.
We can't alter the session in Oracle database.
Can anyone please suggest a method to truncate or convert Timestamp type to Date alone while comparing.
------------------------------
Monisha M
------------------------------