Example: InsVal for variant_row - check the variant row null flags and use this to decide whether or not to write NULL values to the database.

// this example shows how to use the null status flag information from variant_row's data fields
// to properly set the corresponding flags in the BoundIOs for a record to insert

// here we want to make sure that any NULL data in the variant_row
// gets reflected in the resulting parameters that are sent to the database
// *** Note: This example is the actual implementation of the DefaultInsValidate
// for variant_row in the DTL library ***


template<> class dtl::DefaultInsValidate<variant_row>
{
public:

	bool operator()(BoundIOs &boundIOs, variant_row &rowbuf) {

		boundIOs.ClearNull(); // clear null on all BoundIO's

		for (BoundIOs::iterator b_it = boundIOs.begin();
				b_it != boundIOs.end(); b_it++)
		{
			BoundIO &boundIO = (*b_it).second;

			if (boundIO.IsParam()) // rowbufs could have parameters in the case of sql_iterator
				try{
					if(rowbuf[boundIO.GetName()].IsNull())
						boundIO.SetNull();
					else
						boundIO.ClearNull();
				}
				catch(...) 
				{
					// This parameter # is not part of the rowbuf, lives in ParamBuf instead
					boundIO.ClearNull();
				}
			else
				if(rowbuf[boundIO.GetName()].IsNull())
					boundIO.SetNull();
				else
					boundIO.ClearNull();

		}
		return true;
	}

	~DefaultInsValidate() {};
};