Re: [gnome-db] Defined column size.





2009/6/22 Bas Driessen <bas driessen xobas com>
Hello,

Question. In V3 there was the quick and convenient function: "gda_column_get_defined_size" to get the width of a returned column from the database. This no longer exists. I believe the solution should be something along the lines of:

const GValue *value;
value = gda_column_get_attribute (column, GDA_ATTRIBUTE_DEFINED_SIZE)

This GDA_ATTRIBUTE_DEFINED_SIZE (or similar name)  does not exist. What is the best/quickest way to get this value? If possible a small code sample, which often makes things easier to understand.

This feature was removed from the V4 because it was not reliable (I mean it worked in most cases but reported some wrong values sometimes).

The best way to do this is to query the meta data associated to the tables, ie get information about tables and columns. However, because it takes some time, it's better to cache the result, so you'll have to modify a bit your program's structure for this.

For an example about how to do this, please look at the samples/MetaStore/ example, and the documentation (http://library.gnome.org/devel/libgda/4.0/gda-dict.html) which also has an lenghty introduction about meta data (if you have any remark about the doc. let me know so I can correct it).

Vivien



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