InfoSphere Optim

InfoSphere Optim

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  Date fields in compare file has timestamp also along with date but in actual database the data field has only dates.

    Posted Thu December 19, 2024 08:54 AM

    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
    ------------------------------


  • 2.  RE: Date fields in compare file has timestamp also along with date but in actual database the data field has only dates.

    Posted Fri December 20, 2024 02:04 AM

    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
    ------------------------------



  • 3.  RE: Date fields in compare file has timestamp also along with date but in actual database the data field has only dates.

    Posted Fri December 27, 2024 01:37 AM

    Thanks For the update.

    Actually We have installed only IBM infosphere optim in our server. IBM Infosphere Information server is not installed to do the above mentioned function.

    Is there any way we can do using Column Map procedure?



    ------------------------------
    Monisha M
    ------------------------------



  • 4.  RE: Date fields in compare file has timestamp also along with date but in actual database the data field has only dates.

    Posted Wed January 08, 2025 04:29 AM

    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
    ------------------------------