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.  Sequence logic in LUA

    Posted Wed October 03, 2018 07:59 PM
    Hi , 

    Am looking for Masking function for Sequence in LUA in DB2.

    Scenario : 

    If SSN_NO in TAB_A matches with SSN_NO TAB_B Then Apply lookup function else Apply Sequence.

    Example : Sequence ( 12345,1)

    Start with 12345 and Increment by 1.

    ------------------------------
    Raja shekar Kanukanti
    ------------------------------

    #InfoSphereOptim
    #Optim


  • 2.  RE: Sequence logic in LUA

    Posted Thu October 04, 2018 06:00 AM
    Hi,

    You have to write LUA something like this:

    function cm_transform()

    oldvalue = source.column.getvalue()
    mask_parms = "lookup masking parameters"
    newvalue = optimmask(oldvalue, mask_parms)
    if newvalue is NULL
     newvalue = Sequence(12345, 1)
    end
    target.column.setvalue(newvalue)

    end

    ------------------------------
    Thanks,
    Tulasi
    ------------------------------