NullValue questions

yagi

Member
Can somebody explain me more about NullValue.

I have the following problems with this (maybe there are bugs?).

I have NullValue = nvUnAssigned for OracleSession. In OnDataChange event of DataSource connected with some OracleDataSet i try to do something like this

if(VarIsEmpty(ords1->FieldByName("FIELD1")->Value))
ords2->FieldByName("FIELD2")->Clear();
else
ords2->FieldByName("FIELD2")->AsFloat = ords1->FieldByName("FIELD1")->AsFloat;

it doesn't work.
When i check type of Variant value of the field like this:

int vtype;
vtype = ords1->FieldByName("FIELD1")->Value.Type();

it returns 1 that means varNull. Why?

Please help!

Regards
Yagi
 
The TOracleSession->NullValue property does not affect the behaviour of the TField objects. For null values the standard TField behaviour is to return a Null variant value, and this is also the case for a TOracleDataSet. To check for null values you can alternatively use the TField->IsNull property of course.

------------------
Marco Kalter
Allround Automations
 

Similar threads

Back
Top