Jason Roberts wrote:
Many relational databases allow fields to be set to NULL. Is this
supported in OGR? How does one detect whether a field is nullable or not?
Looking at the class documentation, I see functions
OGRFeature::IsFieldSet and OGRFeature::UnsetField. Are these intended
for checking whether a field is NULL and setting it to NULL? Or are they
used for something else, such as determining which fields have been
modified by a caller prior to him calling OGRLayer::SetFeature?
When I looked at OGRFieldDefn, I could not find a method that might be
intended for checking whether a field was nullable (e.g.
OGRFieldDefn::IsUnsettable).
Jason,
IsFieldSet() tests if a feature field is NULL, and UnsetField() can force
it to NULL if it is not.
There is currently no way to test if a datastore supports the concept
of NULL fields, but if it does not it should just write a default value
(0.0, empty string, etc).
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, [email protected]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev