Forum Documentation Showcase Pricing Learn more

SQL Plugin - Offset Error


#1

I am trying to create a way to read more than 200 records from a MySQL db. However the plugin throws an error unless I include a LIMIT statement like: “LIMIT 200”.
In MySQL you can combine an offset into limit like so: “LIMIT 0, 200” however I get an error when I write this as mentioned above.
You can also use OFFSET in MySQL - however it seems that when I use a variable it is being entered into the SQL statement as text - even though I have specified the variable is a number. As a result MySQL throws an error. So this works: SELECT * FROM table_name WHERE owner_id = 11 LIMIT 100 OFFSET 0 but this doesn’t: SELECT * FROM table_name WHERE owner_id = ? LIMIT 100 OFFSET ?where the two parameters are defined.

Any ideas about how to solve this?


#2

Hi there,

did you find a solution or workaround ?
thanks


#3

Hey Arnold! Were you able to dynamically set up offset?


#4

No I never did. I ended up building my own API for the data and hosting it on another server to act as an interface.