New database commands

Dec 26, 2009
29
2
No where
Tried the new database commands in TCC 23. This example is given in the TCC Help file:

echo Testing file write and read
echo %@unqopen[rwc,test.db]
echo %@unqkvf[test.db,"aaa",ansi.cmd]
echo %@unqreadf[test.db,"aaa",newansi.cmd]
echo %@unqclose[test.db]


When I run this, exactly as written in the Help File, line 3 produces an error message:

The system cannot find the file specified.
ansi.cmd
 
May 20, 2008
11,415
99
Syracuse, NY, USA
That example shows @UNQREADF being used with 3 parameters.
Code:
echo %@unqreadf[test.db,"aaa",newansi.cmd]
The help seems to show it requiring at least 4 parameters.
Code:
@UNQREADF[[u,]filename, "key", outputname, length]

Also ... apparently, ansi.cmd MUST exist because it's ENTIRE CONTENTS will be paired with "aaa" in the database. Is that really what's desired/intended? It seems a bit strange to me.
 

rconn

Administrator
Staff member
May 14, 2008
12,364
150
Tried the new database commands in TCC 23. This example is given in the TCC Help file:

echo Testing file write and read
echo %@unqopen[rwc,test.db]
echo %@unqkvf[test.db,"aaa",ansi.cmd]
echo %@unqreadf[test.db,"aaa",newansi.cmd]
echo %@unqclose[test.db]


When I run this, exactly as written in the Help File, line 3 produces an error message:

The system cannot find the file specified.
ansi.cmd

ANSI.CMD is a dummy file name for the purpose of the example; it must exist in your working directory.
 

rconn

Administrator
Staff member
May 14, 2008
12,364
150
Also ... apparently, ansi.cmd MUST exist because it's ENTIRE CONTENTS will be paired with "aaa" in the database. Is that really what's desired/intended? It seems a bit strange to me.

Yes, it must exist, and the entire contents will only be paired with "aaa" if you don't specify a length. Why is that strange?
 
May 20, 2008
11,415
99
Syracuse, NY, USA
Yes, it must exist, and the entire contents will only be paired with "aaa" if you don't specify a length. Why is that strange?
What seems strange is that a copy of the entire file winds up inside the database. Are there situations in which databases actually work that way? Since the file must exist locally, so it would seem more efficient to pair "aaa" with the (fq) name of the file.
 
May 20, 2008
11,415
99
Syracuse, NY, USA
Yes, that's the whole point of a document store database.

If you only need key / value, stick with that.
Hmmm! There's already ZIP (and friends) for a document store database.

You can do the key/value thing in memory ... right? It seems that those wanting an associative array ought to be happy.
 
Similar threads
Thread starter Title Forum Replies Date
cgunhouse Dumping an UNQLITE Database Support 1
vefatica Console not redrawn in BTM or with multiple commands Support 4
Joe Caverly Documentation COMMANDS in Version 27 help Support 8
kb6ojs ALIAS with multiple commands? Support 9
R Long commands retrieved from command history have blank line when wrapped Support 20
vefatica Timing commands with $= in the prompt? Support 16
A Fixed v25 regression: Parameter expansion fails in piped commands Support 2
A Key Commands missing? Support 3
F Regexes in REN/MOVE/… commands seem to not work at all Support 3
gentzel Bug launching external commands in 20.11.43 Support 11
M Keywords for commands, functions, internal variables Support 3
M Disable commands? Support 2
D Fixed 20.10 strangeness with external commands Support 9
thedave Problem chaining piped FIND commands in BTM Support 7
D Some commands are not displaying their command dialog Support 2
C MONITOR commands alter tab title when triggered Support 0
Alpengreis Documentation TC Help v18.x "Commands by Category" is incomplete Support 0
R How to? Launch and execute commands in tcmd.exe through MSBuild Script. Support 3
D WAD TASKBAR window commands confuses our friends at MS Support 4
Stefano Piccardi list of TCC commands for external editors Support 4
I tab completion with directory commands Support 7
I most used commands Support 2
mikea How to? TCC and ftp:// commands Support 7
R Override TCC internal commands Support 2
S Directory history entries from /S option of various commands Support 2
M A simple question related to the "dir" (and "pdir") commands... Support 5
R TC 13 / Using TCDIALOG to exit commands Support 4
J syntax problems multiple commands (command & command) Support 4
C User error with low level file* commands Support 8
S Need help to execute TCC commands on another system Support 6
electrotype keyboard shotcuts to send commands to a TCC tab? Support 8
Charles Dye Updated _bat.schclass with v11 new commands/keywords Support 1
L Vista 64 bits missing commands Support 1
deleyd Commands to launch Control Panel items? Support 10

Similar threads