Re: [gnome-db] gda_connection_execute_select_command and one column



Diego Zuccato writes:
>> There's no row in model but there's one column.
>> I suppose there should be at least one row if there's at least one
>> column.
> Why?

Because it's 2D model and must have x and y :)

>> If my approach is bad, which one is correct?
> Just check how many rows the query returned before trying to access 'em.
> 
> Think the model creation as a 2-step process: first it gets initialized
> by the columns definitions, *THEN* it gets filled by the actual rows
> returned (if any). Even if you run your query in the interactive command
> processor (psql for Postgres, don't know what's for MySql), when you run
> a query you always get an header, even when there are no rows selected.

I really doubt gda returns header. What you talk about is provider's ui
specific. But, if gda really returns header I must missed it in docs.

Anyway. SQL query is *correct*. Execution ( manual ) *returns* field's
value. Why I can not ( or how should I ) get it with GDA and
execute_select_command?

Piotras


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