RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TParam.GetData Method

Fills the buffer with the Value of the parameter in the native format of a database field of the appropriate type.

Pascal
procedure GetData(Buffer: Pointer);
C++
__fastcall GetData(void * Buffer);

Use GetData to obtain the value of a parameter in the format ready to be written directly to the underlying database. That format is the format used by physical database fields corresponding to DataType. Buffer must have enough space to hold the information. Use the GetDataSize method to determine the necessary size. 

The native format for a database field may not be the same as the datatype used by the corresponding field object. Use the As... properties to get the value in the type used by the corresponding field object. Use GetData to get the value in the native database format. 

For example, when DataType is ftBCD, GetData retrieves the value in binary-coded decimal, even though the TBCDField object uses Currency to store and manipulate its values. AsBCD gets the value in the Currency type. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!