Subject | Retrieve default values from a table's metadata |
---|---|
Author | johannes@workmail.com |
Post date | 2001-01-09T05:49:57Z |
On table create I can specify a default value. That's cool.
However, how can I retrieve just those default values for reference.
This does make sense if one is to write highly generic applications.
Yes, I can do the following...
select rdb$field_name
, rdb$default_value
from rdb$relation_fields
WHERE (rdb$field_name not starting with 'rdb$')
and rdb$relation_name = 'ATableName'
...which returns rdb$default_value(s) as blob of subtype 2 (blr).
The simple question, however, is: How do I extract the default
value(s) from the blob?
I did have a look at the blr example, but it did not really hint
anything in the above regard. Any help is much appreciated.
Thanks and cheers
Johannes
However, how can I retrieve just those default values for reference.
This does make sense if one is to write highly generic applications.
Yes, I can do the following...
select rdb$field_name
, rdb$default_value
from rdb$relation_fields
WHERE (rdb$field_name not starting with 'rdb$')
and rdb$relation_name = 'ATableName'
...which returns rdb$default_value(s) as blob of subtype 2 (blr).
The simple question, however, is: How do I extract the default
value(s) from the blob?
I did have a look at the blr example, but it did not really hint
anything in the above regard. Any help is much appreciated.
Thanks and cheers
Johannes