DbServer.BLOBGet Method (Typed) | |
Get the contents of a BLOB, identified by its memo field number.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.19
Syntax VIRTUAL METHOD BLOBGet(
uField AS USUAL,
nStart AS LONG,
nCount AS LONG
) AS USUAL
public virtual Usual BLOBGet(
Usual uField,
int nStart,
int nCount
)
Request Example
View SourceParameters
- uField
- Type: Usual
The name, number, or symbol representing the position of the field in the database file structure. - nStart
- Type: Long
The starting position in the memo field of the BLOB data. If nStart is positive, the starting position is relative to the leftmost character in uFieldPos. If nStart is negative, it is relative to the rightmost character in uFieldPos. 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:BLOBGet() retrieves to the end of the data.
Return Value
Type:
Usual
The BLOB data retrieved from the memo field. The data type of the return value depends on the actual data stored. Use ValType() or UsualType() to determine the data type. If the indicated field is not a memo field, DBServer:BLOBGet() returns NIL.
Remarks Tip |
---|
nStart and nCount apply to string data only. They are ignored for any other data types.
|
DBServer:BLOBGet() is very similar to DBServer:FieldGet(). However, because string type variables cannot be larger than 64KB, DBServer:FieldGet() will raise a runtime error when attempting to retrieve memo fields of this magnitude or greater.
DBServer:BLOBGet() will also raise an error if you attempt to retrieve a field greater than this magnitude; however, you can retrieve any subset of the BLOB data by using an
nCount less than 64KB.
Tip |
---|
BLOB data less than 64KB can be retrieved from a memo field using standard means (for example, referring to the field by name in an expression or using the DBServer:FieldGet() method). |
Examples
This example imports information from a word processing document into a field, then uses DBServer:BLOBGet() to extract the first 25 characters of the field:
1FUNCTION GetFirst25()
2LOCAL nPos
3LOCAL cStr AS STRING
4LOCAL oDBCust := Customer{}
5oDBCust := Customer{}
6
7nPos := oDBCust:FieldPos("WP_DOC")
8
9
10IF oDBCust:BLOBImport(nPos, "c:\app\temp.doc")
11cStr := oDBCust:BLOBGet(nPos, 1, 25)
12ELSE
13cStr := "Error: could not import file!"
14ENDIF
15oDBCust:Close()
16RETURN cStr
See Also