Thank you for the response Ankur.
I changed the LIB into MSS since we are using 11.3.0.7 and the lookup table as schema.table name in "ID". But I'm still getting the same error as
" Column: CUST_LAST_NAME_X: IOQDP0558E: Failed to connect to the database"
Is there anything else I'm missing here ?
Also , I need some clarity on the "CONN" parameter in LUA. Is this the connection string that we use to create a connection to that server or is it the DB name ? I have mentioned the connection string here.
------------------------------
Hariharan Paramasivam
------------------------------
Original Message:
Sent: Tue February 18, 2020 12:58 AM
From: Ankur Agrawal
Subject: Optim LUA -error
Hello Hari,
I see couple of issues with the code
- tparm = tparm .. 'lib=DB2LUW,' -- this is referring to DB2 LUW, use "MSS" for SQLServer
- tparm = tparm .. 'id="optimdata.soptimdataowner.lookname",' -- this parameter is supposed to include only schema.tablename, it seems you are including the Optim DB Alias name as well.
Please refer to below link for working example on Oracle
https://www.ibm.com/support/knowledgecenter/en/SSMLQ4_11.3.0/com.ibm.nex.mod.doc/topics/opmod-c--lookup_providers.html
------------------------------
Ankur Agrawal
Original Message:
Sent: Mon February 17, 2020 01:10 AM
From: Hariharan Paramasivam
Subject: Optim LUA -error
Hello everyone ,
Hope you are doing good. I have written a LUA for masking names in Designer and using a lookup table that is present in SQL server. Whenever I run the LUA , all the rows in the table gets skipped and the below error gets thrown up in the last record. Would like to get your expert assistance on this..
Error :
"User DLL or Proc requested termination while processing "Table Name" Column Map Procedure set on column CUST_LAST_NAME_X encountered an error at line 27 while processing row 52: Column: CUST_LAST_NAME_X: IOQDP0558E: Failed to connect to the database
Cannot overwrite the source file when the convert process contains rows with errors or user cancelled the request. "
Below is my code
function cm_transform()
a=optim.source.getcolumnvalue("CUST_LAST_NAME_X")
b=optim.source.getcolumnvalue("CUST_FIRST_NAME_X")
optim.print("a:" .. a)
tparm = 'PRO=HASH_LOOKUP,HASHFLD="SEQ",SRC="CUST_LAST_NAME_X",'
tparm = tparm .. 'DEST="CUST_FIRST_NAME_X,CUST_LAST_NAME_X",REP="FIRST_NAME,LAST_NAME",'
tparm = tparm .. 'lib=DB2LUW,'
tparm = tparm .. 'user=admin,pass=xxxx,' (got the user name and password to login the SQL server housing the lookup table)
tparm = tparm .. 'id="optimdata.soptimdataowner.lookname",'
tparm = tparm .. 'FLDDEF1=(NAME="cust_first_name_x",DT=CHAR),'
tparm = tparm .. 'FLDDEF2=(NAME="cust_last_name_x",DT=CHAR)'
optim.print("tparm :" .. tparm)
lname,fname= optim.mask(a,b,tparm)
optim.print("last name:" .. lname)
optim.print("first name:" .. fname)
optim.target.setcolumnvalue("cust_last_name_x",lname)
optim.target.setcolumnvalue("cust_first_name_x",fname)
end
------------------------------
--Hari
------------------------------
#InfoSphereOptim
#Optim