sql.so is loaded on 'package require sql'. It is then removed when the
apache subprocess which parses your ttml page dies (this is a Tcl rule -
you cannot unload a module).

Most people (mostly because of CGI/PHP habits) connect/disconnect once per
page. This is a bit of a resource overhead - permanent SQL connections are
much faster since you don't need to connect every time you make your ttml
page, but only when Apache creates a new child process.

::sqlhand is the handle you set ie:

-- I do this at ChildInit
set ::sqlhand [sql connect $host $user $pass]
sql selectdb $::sqlhand $dbname

-- and this in an example .ttml page
set res [sql query $::sqlhand "SELECT * FROM test"]
while {...} {...}
sql endquery $::sqlhand $res

Actually, I use my sql::* wrappers since they're easier to use - I don't
have to remember about endquery...

ps. davidw also thinks I'm a bit strange and enigmatic person ;)

--
Wojtek Kocjan
[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to