cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Query using OLE DB

MohiniShelke
Level 4
Hello All,
I am using OLE DB connection  in BluePrism.
I am trying to execute following Query:

"SELECT * DISTINCT [User ID ] FROM [Sheet1$]"

But it is throwing following error message:

Internal : Could not execute code stage because exception thrown by code stage: Syntax error (missing operator) in query expression '* DISTINCT [User ID ]'.

Please help me to solve this error.

Thanks

------------------------------
Mohini Shelke
RPA Developer
vElement It
------------------------------
11 REPLIES 11

Hi mohini,

That SQL query is not working for OLEDB....i have updated the distinct query now it's storing the unique value only however i have not incuded all the columns in the query because all the column does not contain the duplicate value for example if you see user id 121477  some of the column like( Training Topics, Training Title, Training vendor and so on) these column does not have duplicate value hence i have excluded those column name from the select query and kept only those column name who have the duplicate value also as a result you will not get those excluded column value in the collection......I have attached the XML please find

------------------------------
Saumitra Sharma
Consultant
EY
Indian/Christmas
------------------------------

Hi Mohini, 

Please try the below query

"SELECT MAX([UserID]) as [UserID] ,[User First Name],[Employee Preferred Name],[User E-mail],[Location]FROM [Sheet1$] GROUP BY[User First Name],[Employee Preferred Name],[User E-mail],[Location]"

You have to define your required columns individually in both select clause and and group by clause.

Regards,
Naga.






------------------------------
Naga Ratna Mareddy
Associate
cognizant
Asia/Kolkata
------------------------------