Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Default field values
Default field values
Posted: 2000/07/20 14:03
 
How can I automatically retrieve default values specified in field definitions on my Oracle server after I do TNcociQuery.Insert?
For example I have Char(1) field with default value 'F'. TDbCheckbox is linked
with that field. When I do Insert, CheckBox shows undefined value, also default 'F' is defined on Oracle.
RE: Default field values
Posted: 2000/07/22 07:12
 
Hi !

There are two different ways:

1) You can assign default expressions to TField.DefaultExpression. For example, you can read defaults from Oracle dictonary, using SQL:
select data_default from all_tab_columns where table_name = :TabName and owner = :Owner
and assign this values to fields. After that, NCOCI8 will assign after insert default values to fields.

2) If you want only refresh field values after posting insert to server, then set TField.AutoGenerateValue = arDefault for fields, that have default values. After that if this fields have NULL value, NCOCI8 will automatically reread they values from server after posting insert.
RE: Default field values
Posted: 2000/07/24 07:50
 
Do you have plans to include auto-fetch default values after open in TOCIQuery?
I guess this should be default behaviour.
RE: Default field values
Posted: 2000/07/24 08:10
 
Yes ! Why not ?!
Stay tuned ...