Not able to fetch proper result with query

activities

#1

Can anyone help me fetching the correct result with query
I am using Execute query Activity and in Query field I am entering this query"SELECT ename FROM telusko1.emp where depto=10 or depto=20; "
It was supposed to result 5 names but it is returning System.Data.DataRow five times.


#2

Hi @anmolk171 ,
The result of Execute Query activity will be a datatable. You have to loop through each row and retrieve the column value you want.
What you have done in the here is correct. Use row(0).ToString or row(“ename”).ToString or row.item(“ename”).ToString to get your column value in the Write Line activity.


#3

@Madhavi Thanks for your help. It is working now