Subject | Re: Type conversion based on domain |
---|---|
Author | bertchughes |
Post date | 2010-03-30T12:21:37Z |
If you're using kinterbasdb, after cursor has executed query cursor.execute(), get description as "cursor.description", eg, for list of names,
fields = [nm[kinterbasdb.DESCRIPTION_NAME] for nm in crs.description]
fields = [nm[kinterbasdb.DESCRIPTION_NAME] for nm in crs.description]
--- In firebird-python@yahoogroups.com, "angel9blaze" <gerdusvanzyl@...> wrote:
>
> Is there a way to get the domain a column belongs to? I have boolean columns that are of "BOOLEAN_D" domain type. Kinterbas of course gives me it back as int which is what they are stored as. cursor->describe does not give the domain so I can't determine if the column is boolean or not.
>
> I have checked the c source and it seems one can get the relation name and field name for a column in a query and is used to retrieve the precision in determine_field_precision and thus one could get the domain as well. Sadly this info is not exposed by python API as far as I can tell.
>
> Anybody have any tip on how to get die domain for a column in a select statement?
>