Re: Number of tuples in a Recordset



Vivien Malerba wrote:

> On mer, 09 fév 2000, you wrote:
>
> >
> > I've found a way to do this without touching the IDL files, which is via the use
> > of GDA_Command_open (CORBA implementation). I've committed the changes in the
> > client lib, so the only thing missing is the postgres provider part. As I've seen
> > in the current code, you should add a "gulong *affected" parameter to
> > gda_postgres_cmd_execute(), and in impl_GDA_Command_open (in gda-postgres.c)
> > inform its "affected" parameter with the "affected" returned by
> > gda_postgres_cmd_execute().
>
> I've commited the necessary changes for the postgres provider to use this.
> However I have 2 problems with this implementation:
> * the recordsets returned for the schemas don't have their number of tuples
> (this is not a big worry, because it is usually not necessary to know the
> number of tuples for them).
> * the problem that bothers me is: how does the client make the difference
> between a recordset returning 0 tuple because that recordset is empty and one
> returning 0 tuples because the provider cannot return the number of tuples?
>

I think I've found the solution to the first problem, since I just updated my local
copy with your changes and found errors in gda-postgres-connection.c: 'too few
arguments in call to gda_postgres_cmd_execute()'...

About the difference between a recordset with 0 tuples and a provider not being able
to tell how many rows it's got: we can just leave as it is (returning 0) and
specifying that you cannot rely on this value, or return -1 to make the difference,
but this will be the same as an error (by convention, all functions returning gint's
return -1 in case of error), so we can return -2 (or whatever). So, what do you
think? I'd vote for the first solution (not very elegant I know).

Cheers



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]