IDTSDataPumpTransform::ValidateSchema

DTS Programming

DTS Programming

IDTSDataPumpTransform::ValidateSchema

The ValidateSchema method validates the schema of the source and destination columns to be transformed.

Syntax

HRESULT ValidateSchema ( LPBYTE pvTransformServerData,
LPCDTSTransformColumnInfo pSrcColumnInfo,
LPCDTSTransformColumnInfo pDestColumnInfo,
IDTSDataConvert *pIDTSDataConvert,
DTSTransformFlags eTransformFlags );

Argument Description
pvTransformServerData [in] Transform server state data
pSrcColumnInfo [in/out] Source column and row data
pDestColumnInfo [in/out] Destination column and row data
*pIDTSDataConvert [in] Pointer to the data conversion interface
eTransformFlags [in] Input flags for transformation validation and execution

Remarks

Pointers to source and destination column information structures are passed to ValidateSchema. The transformation can then validate data types, preventing unintended row transfers if the types are incompatible. If the transformation does not validate at this time (for example, due to a complex conversion performed on the row data), then it simply returns NO_ERROR. A validation failure should return an appropriate failure code, such as DB_E_SCHEMAVIOLATION, or one defined by the transformation server because the data pump cannot proceed.

The pointer to the IDTSDataConvert interface is passed in to allow the destination to verify that conversion between the source and destination data types is possible and to indicate any special conditions that may be encountered.

The transformation flags define the data type promotion, demotion, and conversions that are allowed. Additional custom properties may be defined through a custom interface, in which case the object (such as an IUnknown object) must be created and edited prior to the object being passed to IDTSDataPump::AddTransform.