Subject | Re: [firebird-python] Type conversion based on domain |
---|---|
Author | Pavel Cisar |
Post date | 2010-03-30T10:20:43Z |
angel9blaze napsal(a):
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
> Is there a way to get the domain a column belongs to? I have booleanAnother question not related to Python but Firebird in general. Use
> 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?
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