@UNQKVB[[u,]filename,"key",bhandle[,length]] : Add a key / binary blob value pair to a UnQlite database.

 

uOptional flag that the key and value are Unicode (UTF16)
filenameDatabase opened with @UNQOPEN
keyKey to add or replace
bhandleBinary handle returned by @BALLOC
lengthOptional length (in bytes) to write (if -1 or nor specified, write the entire buffer)

 

Returns 0 if successful, or the error text if not.

 

Example:

 

This example opens a database named "test.db", then allocates a binary buffer, writes it to the database, and then reads it back.

 

echo %@unqopen[rwc,test.db]

set handle=%@balloc[4096]

echo %@unqkvb[test.db,"bbb",%handle,-1]

echo %@unqreadb[test.db,"bbb",%handle,-1]

echo %@unqclose[test.db]

 

See also: @UNQOPEN, @UNQCLOSE, @UNQKVBA.