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

SaumitraSharma
Level 4
Mohini, SQL Query is wrong it should be SELECT  DISTINCT [User ID ] FROM [Sheet1$]...U can use either Distinct or * both not together

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

Hello

You are right but if we user [User ID] , it will return only USER ID values in output 

I want all row data. 



------Original Message------

Mohini, SQL Query is wrong it should be SELECT  DISTINCT [User ID ] FROM [Sheet1$]...U can use either Distinct or * both not together

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

U can use this but this will delete the duplicate data permanently only unique data will be there...delete dups from (select *, row_number() OVER ( partition by [User ID] order by [User ID]) as rn from [Sheet1$]) dups WHERE rn > 1
Select * from [Sheet1$] 
------------------------------

Hi,
I tried this query ,

But getting following error:

Internal : Could not execute code stage because exception thrown by code stage: Syntax error in query expression 'rn > 1Select * from [Sheet1$]'.


Thanks & Regards,


Mohini Shelke

RPA Developer, vElement IT,

Cell : (+91)9503221751

https://velement.io/


22317.gif


------Original Message------

U can use this but this will delete the duplicate data permanently only unique data will be there...delete dups from (select *, row_number() OVER ( partition by [User ID] order by [User ID]) as rn from [Sheet1$]) dups WHERE rn > 1
Select * from [Sheet1$] 
------------------------------

Hi,
There should be space between 1 and Select you have missed the space it should be rn > 1 Select * from [Sheet1$]

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

Hi ,
I tried with space also,still getting same error.

------------------------------
Mohini Shelke
RPA Developer
vElement It
------------------------------

Hi, 
I tried this also but still getting same error. 



------Original Message------

Hi,
There should be space between 1 and Select you have missed the space it should be rn > 1 Select * from [Sheet1$]

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

Hi Mohini,

Can you post your vbo here. Let me check.

------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------

Hello 

I have attache My Process and also the input file.

Please check and let me know what is the error?




Thanks & Regards,


Mohini Shelke

RPA Developer, vElement IT,

Cell : (+91)9503221751

https://velement.io/


22323.gif


------Original Message------

Hi Mohini,

Can you post your vbo here. Let me check.

------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------