Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

UNQLITE and %_unq_db

Aug
1,929
71
Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  27.00.21 x64   Windows 10 [Version 10.0.19042.867]

When I close an UNQLITE database, %_unq_db still returns the name of the current database.

Code:
@setlocal
@echo off

set thedb=jlc.db

echo Opening database for read/write/create
unqlite /db:"%thedb" /rwc

echo Name of current database: %_unq_db

unqlite /db:"%thedb" /kvs "keyone" "This is a string value assigned to keyone"

unqlite /db:"%thedb" /r "keyone"

echo Closing the database
unqlite /c

echo Name of current database: %_unq_db

endlocal
quit

Code:
e:\utils>testun
Opening database for read/write/create
Name of current database: E:\Utils\jlc.db
Closing the database
Name of current database: E:\Utils\jlc.db

Should %_unq_db still be returning the name of the current database, even though I have closed the database?

Joe
 
Thanks Rex. I missed it previously, but I do see your reference in the help file;
If this option is omitted, UNQLITE will use the last database name (if any).

Joe
 
Back
Top