Hi All,
I have query in assign activity and between that query I need to insert EmpID’s (I have saved in String), how we can do this?
Not sure where exactly I am doing wrong here. Below is what I tried:
1: Reading all ID’s from CSV. storing in csvDt
2: I am storing all ID’s in var = ListIDs of datatype → ListofString using below expression:
csvDt.AsEnumerable().Select(Function(row) Convert.ToString(row(“ID”))).ToList()
Getting o/p as below: ListIDs =
Listofstring
{
“A6556”,
“E4359”,
“Y2424”,
“P5252”
}
3: Idstring is of string datatype where I am storing values: ‘A6556’,‘E4359’,‘Y2424’,‘P5252’
using this expression: “‘” + String.Join(“‘,’”, ListIDs) + “’”
O/p:
‘A6556’,‘E4359’,‘Y2424’,‘P5252’
4: Now,
arr_ids = String.Join(“,”, Idstring.Select(Function(x) “‘” & x.Trim & “’”))
arr_ids is of datatype String → And I am getting error in this assign activity expression (which is arr_ids).
Also, I tried below:
1.Read IDs from CSV into ListIDs:
ListIDs = csvDt.AsEnumerable().Select(Function(row) row(“ID”).ToString).ToList()
2.Converted arr_ids to string for SQL:
arr_ids = String.Join(“,”, ListIDs.Select(Function(x) “‘” & x.Trim & “’”))
Result: ‘A6556’,‘E4359’,‘Y2424’,‘P5252’
3.Used arr_ids inside my query:
“… WHERE EMPLOYEES.ALTER_EMPLID IN (” + arr_ids + “) …”
But still getting error something like “Argument value :compiler error”.
Nutshell: I want to insert list of ID’s (Eg: ‘A6556’,‘E4359’,‘Y2424’,‘P5252’, etc) between the SQL query.
Thank you
BR,
NK




