Great question. That is actually based on database support. So, in
some databases (Access, DB2, Derby, MSSQL) it is just a cut of the
returned query. In others (MySQL, Oracle, PostGreSQL) the OFFSET
statement is used in the query itself.
At some point, I would like to create an "MSSQL2008" adaptor to take
advantage of the new features in that version of MS SQL (the "MSSQL"
adaptor is documented to support 2000 and above).
For anyone writing your own adaptor for a database with offset
support, see the following methods for offset functionality:
dbHasOffset, getMaxRowsPrefix, getMaxRowsSuffix, getMaxRowsWhere.
Steve
--
You received this message because you are subscribed to the Google Groups "DataMgr" group.
To post to this group, send email to dat...@googlegroups.com.
To unsubscribe from this group, send email to datamgr+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/datamgr?hl=en.
That is exactly the plan. It is just a matter of making the time to do it.
If you are in a hurry to get that, you could always make the connector
yourself. As you indicated, it shouldn't be too difficult.
I am hoping to get to it pretty soon myself, but I don't have a
history of making good predictions of when I will get things done for
my open source projects (client demands tending to overwhelm internal
plans).
Steve
> To unsubscribe from this group, send email to datamgr+u...@googlegroups.com.
I looked into this a bit tonight and frankly don't know where to start. I thought about adding a supported database type called MSSQL2008, but in reality, I'm not sure this is the right approach. The ROW_NUMBER() attribute and associated functions to use it for OFFSET mimicking have been around since MSSQL2005. That leaves only MSSQL2000 as unsupported, while both MSSQL2008 and R2 support it as well. Would it not be better to rewrite the default query for the newer (and presumably, more popular) versions in use, and have a fallback to the un-optimized version for 2000? I would imagine that once the database is identified as MSSQL we could run SELECT SERVERPROPERTY('productversion') to get the version number, with version 8 and lower getting the fallback code and 9 and higher taking advantage of the code I posted earlier.
Also, from the post I read earlier (along with the 2.5 docs) I tried the offset method, be it unoptimized, on a test query and it did not work on a MSSQL table. Is it implemented yet? (I am running the 2.5 beta.)
Sean
Sean,
Steve
>> > datamgr+u...@googlegroups.com<datamgr%2Bunsubscribe@googlegr
>> > datamgr+oups.com >
You have inspired me.
I didn't know about SELECT SERVERPROPERTY('productversion') and that
really opened some doors for me. Although my offset was working for
SQL Server on my local copy (probably some modification that I hadn't
committed to the public repo yet), I went ahead and added the feature
using a version of the syntax found here:
http://stackoverflow.com/questions/187998/row-offset-in-ms-sql-server
By use of the SQL syntax you provided to get a version number, I was
able to avoid having a separate file for different versions of SQL
Server. Instead it detects the version currently running and responds
appropriately (either using the default slicing behaviour or the newer
syntax available to SQL Server 2005 and better).
I uploaded all of this to the public repo:
http://sebtools-svn.cvsdude.com/DataMgr
What is up here is very close to what will be DataMgr 2.5 Beta 1, I
just have a few very small tweaks and a bit of testing between here
and there (not to mention some vacation time).
Thanks for the help on this and let me know how it goes for you,
Steve
Great to hear..I'm going to play with it this weekend and will report back.
By the way, not a big deal, but I just noticed while pulling down the files that the displayname of some of the DB-specific files still read MS-SQL....can't say I haven't done that a few hundred times...lol
--Sean
Sean,
You have inspired me.
Steve
>>> > datamgr+r