Subject | Re: [IBO] Connection.DefaultFieldTrimming |
---|---|
Author | Helen Borrie |
Post date | 2008-01-31T23:53:02Z |
At 07:14 AM 1/02/2008, Edward Dressel wrote:
-- for a specific column in the BeforePrepareSQL phase using the Trimming attribute of TIB_Column
-- for selected fields in a dataset using the FieldsTrimming structure of the dataset
-- for selected fields globally using the FieldsTrimming structure of the connection
In all cases.-
-- a column-level setting overrides one that is set at dataset level
-- a dataset-level setting overrides one that is set at connection level
-- connection-level settings prevail over the DefaultNoTrimming setting
You can make the settings statically in the IDE or as run-time settings. However, bear in mind that you can't change a setting while the statement is in a Prepared state. Use the OnPrepareSQL event.
TIBODatabase is a TIB_Connection descendant so design-time settings for FieldsTrimming at connection level should be respected.
At dataset level, TIBODataset's InternalDataset *is* a TIB_Statement descendant (a TIB_BDataset, AFAIR). It should be possible to apply FieldsTrimming and IB_Column attributes to the InternalDataset in your run-time code, either at create time if you want it to be static or at statement prepare time if you want conditional control.
Do study the help for these properties.
Helen
>Some questions about DefaultNoTrimming on a TIBODatabase:It's your choice. You can set the trimming behaviour
>
>1) Is there any control at the TIB_Dataset level for a dataset
>configuration or must I configure each field in the FieldsTrimming?
-- for a specific column in the BeforePrepareSQL phase using the Trimming attribute of TIB_Column
-- for selected fields in a dataset using the FieldsTrimming structure of the dataset
-- for selected fields globally using the FieldsTrimming structure of the connection
In all cases.-
-- a column-level setting overrides one that is set at dataset level
-- a dataset-level setting overrides one that is set at connection level
-- connection-level settings prevail over the DefaultNoTrimming setting
You can make the settings statically in the IDE or as run-time settings. However, bear in mind that you can't change a setting while the statement is in a Prepared state. Use the OnPrepareSQL event.
>2) Is there any control for TIBODataset? The DefaultNoTrimming did notWell, DefaultNoTrimming is a connection-level setting so it is applied to the InternalDataset of TIBODataset. The problem with TIBODataset is that the fields are exposed to you as TFields. IBO doesn't have any control over the default behaviour of the properties that fields and statements inherit from TDataset.
>seem to affect the values entered here (i.e. the data was not
>trimmed). Am I missing something?
TIBODatabase is a TIB_Connection descendant so design-time settings for FieldsTrimming at connection level should be respected.
At dataset level, TIBODataset's InternalDataset *is* a TIB_Statement descendant (a TIB_BDataset, AFAIR). It should be possible to apply FieldsTrimming and IB_Column attributes to the InternalDataset in your run-time code, either at create time if you want it to be static or at statement prepare time if you want conditional control.
Do study the help for these properties.
Helen