• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic