DbServer.BLOBDirectGet Method (Typed) | |
Retrieve data stored in a BLOB file without referencing a specific field.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.19
Syntax VIRTUAL METHOD BLOBDirectGet(
nPointer AS LONG,
nStart AS LONG,
nCount AS LONG
) AS USUAL
public virtual Usual BLOBDirectGet(
int nPointer,
int nStart,
int nCount
)
Request Example
View SourceParameters
- nPointer
- Type: Long
A pointer to the BLOB data. This pointer can be obtained using DBServer:BLOBDirectPut(), DBServer:BLOBDirectImport(), or DBServer:FieldInfo(DBS_BLOB_POINTER, nFieldPos).
- nStart
- Type: Long
The starting position in nPointer. If nStart is positive, the starting position is relative to the leftmost character in nPointer. If nStart is negative, it is relative to the rightmost character in nPointer. If nStart is omitted, it is assumed to be 1.
- nCount
- Type: Long
The number of bytes of data to retrieve, beginning at nStart. If nCount is larger than the amount of data stored, excess data is ignored. If omitted, DBServer:BLOBDirectGet() retrieves to the end of the data.
Return Value
Type:
Usual
The data retrieved from the BLOB file. The data type of the return value depends on the actual data stored. Use ValType() or UsualType() to determine the data type.
Remarks Tip |
---|
nStart and nCount apply to string data only. They are ignored for any other data types.
|
DBServer:BLOBDirectGet() retrieves data stored in a BLOB file without the need to reference a particular field in the data server. It is particularly useful when accessing data that is larger than 64KB, (such as memo fields created with the BLOBImport() method).
Examples
This example illustrates storing setup information in a BLOB file, then selectively retrieving the stored information:
1FUNCTION PutSettings(aColors AS ARRAY,;
2aPaths AS ARRAY, aPW AS ARRAY) AS VOID
3LOCAL aSettings AS ARRAY
4LOCAL oDBSetup AS DBServer
5oDBSetup := Setup{}
6aSettings := {}
7AAdd(aSettings, oDBSetup:BLOBDirectPut(0, aColors))
8AAdd(aSettings, oDBSetup:BLOBDirectPut(0, aPaths))
9AAdd(aSettings, oDBSetup:BLOBDirectPut(0, aPW))
10oDBSetup:BLOBRootPut(aSettings)
11oDBSetup:Close()
12FUNCTION GetColors() AS ARRAY
13LOCAL aSettings AS ARRAY
14LOCAL aColors AS ARRAY
15LOCAL oDBSetup AS DBServer
16oDBSetup := Setup{}
17aSettings := oDBSetup:BLOBRootGet()
18aColors := oDBSetup:BLOBDirectGet(aSettings[1])
19oDBSetup:Close()
20RETURN aColors
See Also