Subject | Re: [IBO] How to know if a field is COMPUTED BY on the server ? |
---|---|
Author | Dmitry Beloshistov |
Post date | 2005-04-29T15:43:36Z |
Hello, Sylvain!
You wrote to <IBObjects@yahoogroups.com> on Fri, 29 Apr 2005 17:07:42 +0200:
SP> In order to have this information, I'm creating a TIBOQuery, setting
SP> "SELECT FIRST 1 * FROM TABLENAME" as the SQL and opening it.
You can call only Prepare method - should be more fast.
SP> The problem is that I'm making INSERTs on these tables and there's
SP> got problems when trying to write into a field that is computed by
SP> the server. I would like to know if a field is a COMPUTED BY field.
SP> Is it possible easily ?
AFAIK, TIBOQuery not give extended information about fields (its may be
wrong - I`m don`t use TIBOxxx components).
1) Get Field domain name from RDB$RELATION_FIELDS as:
SELECT RDB$FIELD_SOURCE FROM RDB$RELATION_FIELDS
WHERE UPPER(RDB$FIELD_NAME)=?FieldName
AND UPPER(RDB$RELATION_NAME)=?FieldName
2) Get field is computed on server as:
SELECT RDB$COMPUTED_SOURCE FROM RDB$FIELDS
WHERE RDB$FIELD_NAME=?DomainName // from step 1
3) You can union this two SQL in one ;)))
If computed source is NULL or '' - this field is not computed be server.
WBR,Dmitry Beloshistov AKA [-=BDS=-]
You wrote to <IBObjects@yahoogroups.com> on Fri, 29 Apr 2005 17:07:42 +0200:
SP> In order to have this information, I'm creating a TIBOQuery, setting
SP> "SELECT FIRST 1 * FROM TABLENAME" as the SQL and opening it.
You can call only Prepare method - should be more fast.
SP> The problem is that I'm making INSERTs on these tables and there's
SP> got problems when trying to write into a field that is computed by
SP> the server. I would like to know if a field is a COMPUTED BY field.
SP> Is it possible easily ?
AFAIK, TIBOQuery not give extended information about fields (its may be
wrong - I`m don`t use TIBOxxx components).
1) Get Field domain name from RDB$RELATION_FIELDS as:
SELECT RDB$FIELD_SOURCE FROM RDB$RELATION_FIELDS
WHERE UPPER(RDB$FIELD_NAME)=?FieldName
AND UPPER(RDB$RELATION_NAME)=?FieldName
2) Get field is computed on server as:
SELECT RDB$COMPUTED_SOURCE FROM RDB$FIELDS
WHERE RDB$FIELD_NAME=?DomainName // from step 1
3) You can union this two SQL in one ;)))
If computed source is NULL or '' - this field is not computed be server.
WBR,Dmitry Beloshistov AKA [-=BDS=-]