RE: [PHP-DB] ms sql limit equivalence

2003-01-24 Thread Grant, Dean (OIT)
Thanks! I was going to write and say that I have been using ADODB but was
unable to make the SelectLimit function work using MS SQL, but I decided to
take a look at my setup one more time.  I have setup my own abstraction
layer on top of ADODB so that I can override some of the default functions
and or adjust them as need be, but it appears that when I wrote the
interface to the SelectLimit function I neglected to send the $nrows and
$offset values to ADODB.  It is now fixed and working nicely.  Thanks again
for the advice.

Dean
-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 23, 2003 8:21 PM
To: Grant, Dean (OIT); [EMAIL PROTECTED]
Subject: RE: [PHP-DB] ms sql limit equivalence

> I am just joining this list so if this has been covered in the past I
> apologize.  I am working with MS SQL and would like the functionality
that
> MySQL's limit function provides.  I understand that MS SQL has no such
> command or equivalent. Has someone found a way to use standard (or MS
SQL
> specific) SQL to achieve the same goal?  I have seen bits and pieces
of
> code
> and ideas here and there, but nothing seems to work.  Any advice would
be
> appreciated.

In addition to the TOP suggestions, you may want to check out some of
the Abstraction layers out there, i.e. PEAR or ADOdb. I'm pretty sure
they replicate the LIMIT function somehow. You can use one of those
programs or just take when they do and adapt to your needs.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] ms sql limit equivalence

2003-01-23 Thread John W. Holmes
> I am just joining this list so if this has been covered in the past I
> apologize.  I am working with MS SQL and would like the functionality
that
> MySQL's limit function provides.  I understand that MS SQL has no such
> command or equivalent. Has someone found a way to use standard (or MS
SQL
> specific) SQL to achieve the same goal?  I have seen bits and pieces
of
> code
> and ideas here and there, but nothing seems to work.  Any advice would
be
> appreciated.

In addition to the TOP suggestions, you may want to check out some of
the Abstraction layers out there, i.e. PEAR or ADOdb. I'm pretty sure
they replicate the LIMIT function somehow. You can use one of those
programs or just take when they do and adapt to your needs.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] ms sql limit equivalence

2003-01-23 Thread Jeffrey_N_Dyke

i forget exactly how to use it, but look up TOP.  although it does not
perform like LIMIT.

hth
Jeff


   
 
"Grant, Dean   
 
(OIT)"   To: "'[EMAIL PROTECTED]'" 
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]   cc:   
 
b.ca>Subject: [PHP-DB] ms sql limit 
equivalence 
   
 
01/23/2003 
 
05:47 PM   
 
   
 
   
 




Hi,

I am just joining this list so if this has been covered in the past I
apologize.  I am working with MS SQL and would like the functionality that
MySQL's limit function provides.  I understand that MS SQL has no such
command or equivalent. Has someone found a way to use standard (or MS SQL
specific) SQL to achieve the same goal?  I have seen bits and pieces of
code
and ideas here and there, but nothing seems to work.  Any advice would be
appreciated.

Thanks,

Dean

Ps. If someone would like a table schema and brief example to work with:

Table table1 with columns a and b

Retrieve 5 entries from table1 sorted by a
Retrieve next 5 entries from table1 sorted by a






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php