[ic] perl problem with $Tag->set...
Chris Snow
interchange-users@icdevgroup.org
Sun Mar 9 10:48:00 2003
Thank you, it worked.
Is there any specific documentation on namespaces?
----- Original Message -----
From: "Stefan Hornburg" <racke@linuxia.de>
To: <interchange-users@icdevgroup.org>
Sent: Sunday, March 09, 2003 1:13 AM
Subject: Re: [ic] perl problem with $Tag->set...
> On Sat, 8 Mar 2003 19:50:51 -0500
> JOHN <java02@ureach.com> wrote:
>
> > > "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.
> > >
> >
> > why is that determined to break? isn't it the same thing? I
> > still dont know enough about IC. This is just a question.
>
> I recommend to figure out the different namespaces and their
> accessor tags from the documentation.
>
> WRT your code (not tested):
>
> [calc]
> @stuff = ('', 'Aural', 'Piano trio');
> $Values->{sm_fulltype}=$stuff[$CGI->{sm_type}];
> ''
> [/calc]
>
> should work with your query.
>
> Bye
> Racke
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>