@UNQOPEN[mode,filename] : Open an UnQLite database. Use the same database name for the other @UNQ... functions.
The possible values for mode are:
RWC | Open a database with read+write privileges. The database is created if it doesn't exist. |
RW | Open the database with read+write privileges. If the database does not exist, an error is returned. |
RO | Open the database in read-only mode. If the database does not exist, an error is returned. |
MM | A read-only memory-mapped view of the database. |
If filename is ":mem:", then a private in-memory database is created. The in-memory database will be discarded when the database is closed.
If the specified database is already opened, @UNQOPEN will not open a new instance. So you cannot have the same database open with different read/write modes.
@UNQOPEN returns 0 if the database was successfully opened (or is already open), or non-zero on an error.
Example:
Open the database "test.db" :
set db=test.db
set result=%@unqopen[rwc,%db]