[ic] SQL Statements within Usertags

Stefan Hornburg interchange-users@icdevgroup.org
Thu Jan 16 07:21:01 2003


On Thu, 16 Jan 2003 09:52:35 +0000
Rich Doughty <rich@opusvl.com> wrote:

> whats the "recommended" way of executing SQL within a usertag? I've been
> using $Tag->sql (...), but is there any way of accessing the DB connection
> object for example, and avoiding the $Tag->sql (...) overhead?

I often use the following technique:

[perl tables=foo]
$set = $Db{foo}->query('select question,answer from foo');
for (@$set) {
    ($question, $answer) = @$_;
    ...
}
[/perl]

Ciao
            Racke