• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

LIMIT keyword and SQL Server

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

generic_queries.sql uses LIMIT keyword but SQL Server doesn't support it. So users get an exception (in my case, when a forum is moderated by a group and group name is clicked at the bottom of the forum page - UserModel.selectAllByGroup query).

So sqlsever.sql should include UserModel.selectAllByGroup, but I couldn't find an equivalent keyword in SQL Server. What can be done?

My temp solution was to copy UserModel.selectAllByGroup to sqlsever.sql and to change it as:


[originally posted on jforum.net by cagin]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you getting this error:
ERROR: LIMIT #,# syntax not supported.
Use separate LIMIT and OFFSET clauses.

I am seeing this with postgres and the recent 2.1.5 source.
[originally posted on jforum.net by shoemaker]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fixed LIMIT , OFFSET errors were fixed with a cvs update.
[originally posted on jforum.net by shoemaker]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, actually my error message was something like "LIMIT: Unknown keyword", I couldn't find the output file, so couldn't copy the exact error here. But the error (and SQL Server documentation) says that SQL Server doesn't support LIMIT keyword at all.

In my temp solution, I just removed it. It now works, but I don't know what's going to happen, when number of records are too much...

I guess your solution is for posgres. But thanks for the reply
[originally posted on jforum.net by cagin]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Found the exact error, and it happens very frequently

I'm removing LIMIT from all queries, but this may have other side effects...


[originally posted on jforum.net by cagin]
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic