Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

LIMIT in Hypersonic and MySQL.

 
Chris Harris
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am currently looking at creating a database component that can be used with both Hypersonic and MYSQL. As I am required to execute large statments a need to use the limit SQL keyword.

I have notice a differance between Hypersonic and MySQL. In Hypersonic the syntax is:



However In MySQL the syntax for limit is:



So I can't send the same statements to both database.

I was wondering which one is the standard way for the LIMIT syntax.

Once I know the standard way this should be done I may start looking at the database code for the non-standard one. May even be able to make them both the same

Thanks

Chris.
 
Srinivas Gogineni
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Hypersonic SQL is "In memory database".So it may not statisfy all the sandard SQL notations.

Thx and regards
-Srini
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
curious argument
mySql doesn't have views and subqueries...

however - the postgresql looks a bit like mySql:


SQL isn't standardized that much, (a nuisance) - perhaps it's wise to look what the market-leader (oracle) is saying?
[ May 27, 2004: Message edited by: Stefan Wagner ]
 
Albert Gan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as i can remembered, the limit syntaxes differ from 1 vendor to another, ex mysql uses keyword limit, oracle uses the rownum function, etc.

It's almost impossible to use standard ways in persistence layer. Perhaps you should code different classes for different database/any other legacy systems, and plug the correct ones to the business process tier. Data Access Object, Inversion of Control/Abstract Factory and Factory pattern could do some help.

good luck to you ^^
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic