Groups | Search | Server Info | Login | Register


Groups > comp.lang.tcl > #55681

Re: Optimal used of sqlite

From Rich <rich@example.invalid>
Newsgroups comp.lang.tcl
Subject Re: Optimal used of sqlite
Date 2026-04-29 21:56 +0000
Organization A noiseless patient Spider
Message-ID <10stuq3$83nr$2@dont-email.me> (permalink)
References <10st8ah$14ekd$1@tota-refugium.de> <10st9d0$156i$1@dont-email.me> <10ste7r$15qud$1@tota-refugium.de> <10stg30$15s8e$1@tota-refugium.de> <10stt8j$14s5d$1@tota-refugium.de>

Show all headers | View raw


meshparts <alexandru.dadalau@meshparts.de> wrote:
> Am 29.04.2026 um 19:44 schrieb meshparts:
>> Am 29.04.2026 um 19:13 schrieb meshparts:
>>> Am 29.04.2026 um 17:50 schrieb Rich:
>>>> Use sqlite's ability to directly address Tcl variables instead:
>>> Thanks Rich! I wasn't aware, that this trick also works for sqlight (I 
>>> know it from Tcl itself when using "expr".
>>>
>>> This indeed cut the time by 50%.
>>>
>>> I had to put the single quotes back though:
>>>
>>> db eval {INSERT INTO results VALUES('$step-global','$Im')}
>>>
>>> Without the quotes, I got some weird errors.
>> 
>> I hat to roll back, since the new solution write empty string to the DB.
>> 
>> At least my old command to retrieve the data does returns an empty string:
>> 
>> db eval "SELECT data FROM results WHERE key='$setnum-global'"
>> 
>> I don't understand why...
> 
> Got it: I'm using a variable in the first argument of VALUES, which is 
> not supported, when using curly braces.

Note this sentence from your other posting quoting the sqlite tcl api 
documentation:

   Tcl variable names can appear in the SQL statement of the second 
   argument in any position where it is legal to put a string or number 
   literal.

As it is legal to put a string or number literal in the first slot, it 
is also legal to put a variable reference there as well.

As to your other posts, I'm not following what problem you are finding.  
Is the database storing empty string when the list had X elements?  Or 
is the list empty (empty string), but the database is storing something 
other than "empty string"?

Back to comp.lang.tcl | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 17:32 +0200
  Re: Optimal used of sqlite Rich <rich@example.invalid> - 2026-04-29 15:50 +0000
    Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 19:13 +0200
      Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 19:44 +0200
        Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 19:58 +0200
          Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 20:06 +0200
        Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 23:29 +0200
          Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 23:50 +0200
            Re: Optimal used of sqlite rene <user4652@newsgrouper.org.invalid> - 2026-04-30 09:22 +0000
              Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 11:43 +0200
                Re: Optimal used of sqlite rene <user4652@newsgrouper.org.invalid> - 2026-04-30 13:09 +0000
                Re: Optimal used of sqlite Ralf Fassel <ralfixx@gmx.de> - 2026-04-30 15:35 +0200
                Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 15:49 +0200
          Re: Optimal used of sqlite Rich <rich@example.invalid> - 2026-04-29 21:56 +0000
            Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 00:12 +0200
              Re: Optimal used of sqlite Rich <rich@example.invalid> - 2026-04-29 22:22 +0000
                Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 08:00 +0200
                Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 08:34 +0200
                Re: Optimal used of sqlite Ralf Fassel <ralfixx@gmx.de> - 2026-04-30 14:38 +0200
    Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 19:15 +0200
      Re: Optimal used of sqlite Rich <rich@example.invalid> - 2026-04-29 21:54 +0000
        Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 00:08 +0200
        Re: Optimal used of sqlite Julian Bradfield <jcb@inf.ed.ac.uk> - 2026-04-30 10:25 +0000

csiph-web