Click or drag to resize

DbServer.BLOBRootPut Method (Typed)

X#
Store data in the root area of a BLOB file.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD BLOBRootPut(
	uBlob AS USUAL
) AS USUAL
Request Example View Source

Parameters

uBlob
Type: Usual
The data you want to put into the BLOB file's root area. uBLOB can be any X# usual data type, except code block and object.

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
Remarks
DBServer:BLOBRootPut() allows the storage of one—and only one—piece of data to a BLOB file's root area (there is no size limitation on this one piece of data). After storing the new data, DBServer:BLOBRootPut() releases the space associated with any data previously stored in the BLOB file's root area.
Tip Tip
Because the root data does not reference a particular record in the data server, it is not affected by DBServer:RLock(), nor is it subject to the DataServer:ConcurrencyControl settings. Therefore, if the data server is opened in shared mode, you should use DBServer:BLOBRootLock() before calling DBServer:BLOBRootGet().
Examples
This example uses DBServer:BLOBRootPut() to store system settings to a BLOB file after modification:
X#
 1FUNCTION UpdateSettings()
 2LOCAL aSettings AS ARRAY
 3LOCAL oDBCust AS DBServer
 4oDBCust := Customer{}
 5IF oDBCust:BLOBRootLock()
 6// Get any existing settings
 7aSettings := oDBCust:BLOBRootGet()
 8IF Empty(aSettings)
 9// This function would populate aSettings with default data
10aSettings := oDBCust:GetDefaultSettings()
11ENDIF
12// This function would allow the user to
13// modify the settings.
14IF oDBCust:ModifySettings(aSettings)
15// Finally, store the settings
16oDBCust:BLOBRootPut(aSettings)
17ENDIF
18oDBCust:BLOBRootUnlock()
19ELSE
20aSettings := {}
21Alert("Could not obtain a lock on the root")
22ENDIF
23oDBCust:Close()
24RETURN aSettings
See Also