@UNQREADB[[u,]filename,"key",handle[,length]]: Read a binary value from an existing key in an UnQlite database.
u | Optional flag that the key is Unicode (UTF16) |
filename | Database opened by @UNQOPEN |
key | Key to read |
handle | A binary handle returned by @BALLOC |
length | Number of bytes to read. If not specified, read the entire binary buffer. |
Returns 0 if successful, or an error if not.
Example:
Open the database "test.db", read the key "btest", and save the binary value to a binary buffer :
set db=test.db
set key=btest
set result=%@unqopen[rwc,%db]
REM Size unknown - let unqreadb expand buffer
set bhandle=%@balloc[1]
set result=%@unqreadb[%db,%key,%bhandle]