@UNQKVB

<< Click to Display Table of Contents >>

Navigation:  TCC-RT > Variables & Functions > Functions >

@UNQKVB

@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
lengthLength of binary buffer to write (or -1 for the entire buffer)

 

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

 

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.