[ic] perl problem with $Tag->set...
Stefan Hornburg
interchange-users@icdevgroup.org
Sat Mar 8 18:57:00 2003
On Sat, 8 Mar 2003 23:35:41 -0000
"Chris Snow" <snowch@care4pcs.com> wrote:
> I am trying to run some decode a variable for input to an sql query. I
> can't get it to work. Can anyone please give me some pointers?
>
>
> [perl]
> $name="sm_type";
> if ($Tag->cgi($name) == 1) { $BODY="Aural" };
> if ($Tag->cgi($name) == 2) { $BODY="Piano Trio" };
> if ($Tag->cgi($name) == 3) { $BODY="String Trio" };
> if ($Tag->cgi($name) == 4) { $BODY="Ensemble with wind" };
>
> $name="sm_fulltype";
> $Tag->set($name, $BODY);
> [/perl]
>
> [query sql="select sku, description, price from products where
> prod_group='sheet music' and category='[value sm_fulltype]' order by
> category2;"
You don't need to use $Tag to access the different namespaces, try
$CGI->{$name}, $Scratch->{$name}, $Values->{$name}. set applies to
the scratch namespace, so your code is determined to break.
Bye
Racke