Re: Problem with CURSOR under MS SQL 7

From: Date: Thu, 11 Jan 2001 20:09:56 +0000
Subject: Re: Problem with CURSOR under MS SQL 7
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-4930@lists.php.net to get a copy of this message
Hello Mauro, Sorry! As you maybe have seen, this is another version than the "countermove-select" (bloody copypaste :), but should work anyway. Cu, Thomas Thomas wrote: > Hello Mauro, > > I don't know exactly why your Cursor doesn't work (e.g. a SET ..... desn't work > yet also, but will be in the next version). > Since you just want simulate the LIMIT (x,y) from mySQL, here's the way I've > done it (Simple "countermove-Select"): > > SELECT TOP $limit WITH TIES * FROM $table WHERE $check2 ID_Fa not in > (SELECT TOP $offset WITH TIES ID_Fa FROM $table WHERE $check1 ORDER BY $mySort1 > ASC, ID_Fa ASC) > ORDER BY $mySort1 ASC, ID_Fa ASC" > > Hope that helps, > Thomas > > "Mauro Boschi (by way of Mauro Boschi )" wrote: > > > Hi, > > I'm trying to understand why something like this: > > > > DECLARE crs CURSOR KEYSET FOR > > SELECT title FROM article WHERE pub_id = 1 > > OPEN crs > > FETCH ABSOLUTE 3 FROM crs > > DECLARE @var INT > > SET @var = 0 > > WHILE (@var<10) > > BEGIN > > FETCH NEXT FROM crs > > SET @var = @var +1 > > END > > CLOSE crs > > DEALLOCATE crs > > > > Doesn't work when you try to embend it in a PHP/MSSQL query!? > > There's something that I doesn't mind about this? > > Maybe a LOCAL PROCEDURE works better? > > > > What I have to do is just emulate the LIMIT function that MySQL have in his > > set of command. This function is very useful when you have to extract only a > > set of row from the query with an absolute start position. > > > > THANKS A LOT > > > > Mauro > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > > For additional commands, e-mail: php-windows-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > > For additional commands, e-mail: php-windows-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#4930) next »