Subject Re: Type conversion based on domain
Author angel9blaze
Sorry maybe I did not explained myself well enough. Let me describe my use case:

I have a directory of files that contain sql select statements, all with joins.
In python I read a file, execute the select statement and on the basis of cursor.describe I generate some code and write it to a file.
So I do not have the table and column name per result column necessary to query the meta tables with. This info seems to be available on the c api but is not exposed in the python api which is why I am asking here.

I will ask on firebird-support if I can get what I am after using sql only but it seems unlikely.

The only workaround I can think of is creating a temporary view and querying the meta tables for the view.

--- In firebird-python@yahoogroups.com, Pavel Cisar <pcisar@...> wrote:
>
> angel9blaze napsal(a):
>
> Another question not related to Python but Firebird in general. Use
> firebird-support list in future, pls.
>
> To get domain name for your column, query system tables:
>
> select rdb$field_source from rdb$relation_fields
> where rdb$relation_name = 'mytable' and rdb$field_name = 'mycolumn';
>
> If you want details about the domain, look it up in rdb$fields table:
>
> select B.* from rdb$relation_fields A
> join rdb$fields B on A.rdb$field_source = B.rdb$field_name
> where A.rdb$relation_name = 'mytable' and A.rdb$field_name = 'mycolumn';
>
>
> best regards
> Pavel Cisar
> IBPhoenix
>