DbServer.BLOBRootPut Method (Typed) | |
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
public virtual Usual BLOBRootPut(
Usual uBlob
)
Request Example
View SourceParameters
- 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 |
---|
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:
1FUNCTION UpdateSettings()
2LOCAL aSettings AS ARRAY
3LOCAL oDBCust AS DBServer
4oDBCust := Customer{}
5IF oDBCust:BLOBRootLock()
6
7aSettings := oDBCust:BLOBRootGet()
8IF Empty(aSettings)
9
10aSettings := oDBCust:GetDefaultSettings()
11ENDIF
12
13
14IF oDBCust:ModifySettings(aSettings)
15
16oDBCust:BLOBRootPut(aSettings)
17ENDIF
18oDBCust:BLOBRootUnlock()
19ELSE
20aSettings := {}
21Alert("Could not obtain a lock on the root")
22ENDIF
23oDBCust:Close()
24RETURN aSettings
See Also