I am trying to call a Sql sequence in Thingworx . i wrote a sql query service in a thing and tried executing it. But it shows the following error "Execute Query failed: com.microsoft.sqlserver.jdbc.SQLServerException: NEXT VALUE FOR function cannot be used if ROWCOUNT option has been set, or the query contains TOP or OFFSET."
how to resolve this?
Thanks in Advance
This is not a TWX issue. I'd suggest reading up on proper SQL query implementation.
If you tried executing your query directly in SQL Manager, you'd get the same error.
I tried in the SQL manager, and actually am not getting that error which i get when i execute the same in thingworx
Instead of executing the sequence as an query separately, i added ' next value for "sequence name" ' in the insert command values itself. like, insert into tablename (id) values (next value for sequenceName) . This solved kind of solved the aforementioned issue.
But, I have another similar issue here.
When i execute a stored procedure in thingworx as SQL query am getting that same old error "NEXT VALUE FOR function cannot be used if ROWCOUNT option has been set, or the query contains TOP or OFFSET." i tried executing this specific procedure in sql directly, it works fine there. But while executing it in Thingworx am getting this error.
Can I get some help regarding this?