Re: [gnome-db] gda_connection_execute_select_command and one column



Piotr Pokora ha scritto:

Try "SELECT * FROM a_table_in_your_db WHERE false".
It returns a model w/o rows. But column descriptions are there.
And GdaDataModel has 1 column because of this description?
It should have a column for each column in the table (if you use * ).
If you select just a column, it must have exactly one column.

Yeah, I understand that backened may return additional headers, but
should I expect that GdaDataModel may also hold headers or any
additional data, which is not retrieved data?
GdaDataModel seems to be designed to return X.Y data model.
They are not "additional". It's just the DB saying "prepare to receive these columns: cola, colb, colc of types: typea, typeb, typec" before actually sending the row data (that might be empty). So you'll have three columns in your model, labeled "cola", "colb" and "colc".

If there's no row and at least one column, then
gda_data_model_get_value_at seems to be a "bit of luck" function.
Why? You simply shouldn't be using it on a row that doesn't exists...

BYtE,
 Diego.



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