-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- ----- Original Message ----- 
From: "Jan Kandziora" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Wednesday, January 25, 2006 9:05 PM
Subject: Re: [sqlite] TCLSQLITE3: Problem inserting a variable in a eval
command


> Am Mittwoch, 25. Januar 2006 20:36 schrieb Lazarus Long:
>> db eval { SELECT * FROM `auction_items` "$where" ORDER BY
>> `endtime`
>> DESC LIMIT 15 }
>>
> The problem is, db eval will treat "where" as a tcl variable for it's
> internal variable expansion, which works only in a limited sql-like,
> not tcl-like fashion. If you want to build a part of the sql statement
> from scratch, you have to write the final eval like this:
>
> db eval "SELECT * FROM auction_items $where ORDER BY endtime"
>
> This way $where is treated with tcl variable expansion *before* "db
> eval" gets it. However, there is a small drawback, as you have to
> protect all variables db eval should treat *internally* with
> backslashes.
>

Jan:

Thank you for your reply. That made it work.

Best regards,

- -- 
Lazarus Long
<lazarus (dot) long (at) bigfoot (dot) com>
GNUPG: <http://wwwkeys.pgp.net/pks/lookup?op=index&search=0x5C1DC205>

Please do not send me attachments in proprietary formats
without request (i.e. Word, PowerPoint or Excel documents),
see <http://www.fsf.org/philosophy/no-word-attachments.html>

Por favor não me envie anexos em formatos proprietários sem que
os tenha pedido (p.e. documentos em Word, PowerPoint ou Excel),
veja <http://www.fsf.org/philosophy/no-word-attachments.pt.html>



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32) - GPGOE 0.4.1

iD8DBQFD2FiZCXRGvVwdwgURAki1AKC6s1viW4uXV/fCa1n2ngBwEqY2HQCgzz3K
81EdcVRnGGHvJxp1sng26ug=
=452d
-----END PGP SIGNATURE-----


Reply via email to