solidDB Help : solidDB reference : solidDB SA: Function reference : SaDynDataMoveRef
  
SaDynDataMoveRef
SaDynDataMoveRef moves a data reference to a dynamic data object.
SaDynDataMoveRef copies the pointer (address) from the parameter named "data" to the appropriate field of the parameter named "dd". The caller must guarantee that the input data is alive as long as the dynamic data object refers to that data.
Note This function copies only the reference, not the data. To copy the data rather than just the reference, see SaDynDataMove.
Typically, the functions SaDynDataMove and SaDynDataAppend are used to set and modify the data value inside the dynamic data object. More memory will be automatically allocated when necessary and all the associated memory will be automatically deallocated when the dynamic data object is disposed of using SaDynDataFree. The user can access the data or the length using the respective functions SaDynDataGetData and SaDynDataGetLen.
The use of SaDynDataMove and SaDynDataAppend might not be feasible when the data already exists completely in a memory buffer. In addition to increasing the memory usage by keeping two copies of the same data, the overhead of the memory copy can be significant if the buffers are large. Therefore, it might be better to directly assign the data pointer by using SaDynDataMoveRef (rather than copying by using SaDynDataMove). In this case, the user can modify or deallocate the memory buffer only after the dynamic data object itself has been freed.
See SaCursorColDynData for a more detailed discussion of "Dynamic Data" (SaDynDataT).
Synopsis
void SA_EXPORT_H SaDynDataMoveRef( SaDynDataT* dd,
  char* data,
  unsigned len)
Parameters
The following table describes the parameters:
 
Parameters
Usage type
Description
dd
in out, use
Dynamic data object
data
in, hold
Data
len
in
Length of data (if the data is a string, this length should include the string terminator)
Return value
None
See also
SaDynDataMove
Go up to
solidDB SA: Function reference