[Mysql-cocoa-users] numOfRows
Brought to you by:
sergecohen
|
From: Famille GOUREAU-S. <sui...@wa...> - 2002-05-22 20:27:24
|
Hi,
does anybody wish to solve a new problem ? (many thanks to Serge for
previous one :) )
Here is the software :
NSLog (@"query : %@",chaine) ; // present the query
result = [connection queryString: chaine]; // send the query
NSLog (@"numOfRows : %d", [result numOfRows]) ; // should give the
number of rows matching the query
while (chaine = [result fetchRowAsDictionary]) // This loop
will test for every row in the query up to the last one
{
NSLog(@"descriptif : %@\n", [chaine objectForKey: @"descriptif"]);
compteurI++ ;
}
NSLog (@"nombre d'enreg correspondants : %d", compteurI) ; //How many
rows are in the response
NSLog(@"descriptif : %@\n", [chaine objectForKey: @"descriptif"]);
And here is the result :
2002-05-22 22:19:17.860 Gestionnaire stock[989] query : select
descriptif, fournisseur from stock where reference like 'M07%' and
fournisseur = 'ABC' ;
2002-05-22 22:19:17.909 Gestionnaire stock[989] numOfRows : 0
2002-05-22 22:19:17.910 Gestionnaire stock[989] descriptif : Marionnette
chat gri
2002-05-22 22:19:17.910 Gestionnaire stock[989] descriptif : Marionnette
chat noi
2002-05-22 22:19:17.910 Gestionnaire stock[989] nombre d'enreg
correspondants : 2
2002-05-22 22:19:17.911 Gestionnaire stock[989] descriptif : (null)
The problem is that a result contain X rows (attested by "nombre d'enreg
correspondants : 2" and by a manual test under unix terminal) and that
the numOfRows function always reply by a 0.
An idea ?
Thanks.
Camille
|