Welcome!

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

SignUp Now!

New database commands

Dec
49
2
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
 
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.
 
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.
 
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.
 
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.
 
Back
Top
[FOX] Ultimate Translator
Translate