@UNQKVB[[u,]filename,"key",bhandle[,length]] : Add a key / binary blob value pair to a UnQlite database.
u | Optional flag that the key and value are Unicode (UTF16) |
filename | Database opened with @UNQOPEN |
key | Key to add or replace |
bhandle | Binary handle returned by @BALLOC |
length | Optional 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]