cancel
Showing results for 
Search instead for 
Did you mean: 

OLEDB Syntax Error

PrajjwalRai
Level 5
Hi,

I am trying to fetch the data into collection using oledb, into parts. For that, I am using the following query

SELECT * FROM [Sheet1$] LIMIT 10000 OFFSET 0

But I am getting Internal Error: Syntax error in FROM clause.

Can someone point out the mistake?

------------------------------
Prajjwal Rai
Application Engineer
Schneider Electric Private Limited
------------------------------
3 REPLIES 3

lookman
Staff
Staff
The OFFSET parm is not valid Prajjwal. Remove it and the select should work fine.

------------------------------
Jack Look
Sr Product Consultant
Blue Prism
------------------------------

Hi Jack,

Can you tell me why it it not valid? Also, I tried with only LIMIT, that is also throwing the same error. Can you please help me?

------------------------------
Prajjwal Rai
Application Engineer
Schneider Electric Private Limited
------------------------------

Hi Prajjwal.

I'm not an OLEDB SQL guy so I don't know precisely why this does not work.

It seems that select * and LIMIT do not work. If you specify the columns, you can use LIMIT. 

When I first responded, I had a test process already set up so I simply added LIMIT and OFFSET, but I had the columns listed. I found that OFFSET failed whereas LIMIT worked, so I said remove OFFSET.

I just tested again with * instead of columns and LIMIT and found it did not work.

Consequently, you should list your columns and use LIMIT. Listing columns is a best practice anyway.

jack

------------------------------
Jack Look
Sr Product Consultant
Blue Prism
------------------------------