Actually, MS SQL has a nice way of doing it that's not specified on there,

ie: SELECT TOP 50 FROM TableX

But you're right, each database has a different way of handling this, if they handle 
it at all.  

My thought on this when trying to solve this problem trying to make it database 
independent is to create another ResultSet object that would handle this for you.  It 
would also handle other database discrepencies in the actual resultset itself (like 
getDate() in MS SQL server returns a different value then getDate() in mysql).

Travis

---- Original Message ----
From: Sam Joseph <[EMAIL PROTECTED]>
Sent: 2002-04-29
To: torque <[EMAIL PROTECTED]>
Subject: Setting limits on returned results

Hi all,

Does anyoneknow if torque has any mechanism to support limits on results 
when the database doesn't support native limits or is complicated to 
implement like MSSQL?  I mean like using the jdbc to limit which results 
come back?

I was getting errors when trying to use limits and offsets on MSSQL.  It 
looks like MSSQL has a really weird way of supporting limits:

http://www.craigsmullins.com/ssu_0900.htm

or at least I haven't quite worked out how this can support me grabbing 
an arbitrary subset of rows.

I see currently the SQLServer adaptor just extends the Sybase one.  I 
managed to actually send queries through by over-riding the 
supportsNativeLimit to return false for SQLServer, assuming that Torque 
would then use jdbc methods to limit the size of the returning set of 
results, but apparently not.

Is there an intention to support that? I know some dbs don't implement 
native limits assuming the jdbc will let you take care of it.

Thanks in advance.

CHEERS> SAM


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to