[ic] assign Query-Result-Row to Usertag
Ingo Buse
ingo.buse at bnc.info
Fri Oct 23 14:43:11 UTC 2009
@Rick, thanks for the advice, I am aware of that, i mentioned 'select *' just to clarify my case.
Thanks Chris and Peter for your Answers, you have been a great help.
Currently i do prefer Peter's Solution, in fact I have modified my pages and the UserTag already and it is working like charm.
--
Ingo
-----Ursprüngliche Nachricht-----
Von: interchange-users-bounces at icdevgroup.org [mailto:interchange-users-bounces at icdevgroup.org] Im Auftrag von Peter
Gesendet: Freitag, 23. Oktober 2009 01:19
An: interchange-users at icdevgroup.org
Betreff: Re: [ic] assign Query-Result-Row to Usertag
On 10/22/2009 07:50 AM, Ingo Buse wrote:
> Hi,
>
> i am having problems understanding the documentation, so maybe u guys may help me out with an example ?
>
> what I want is to forward a result-row of a [query] to my custom made UserTag. I did not really understood the wantarray/hashref stuff.
>
> the query in question also implements a more list and will simply select from products:
>
> [query type=list more=1 ml=10 sql="select * from products where ...."]
> [list]
> [/list]
> [more-list]
> [/more-list]
> [/query]
>
> Now I just want to forward the whole sql-result-row (each product) as hash or array to my UserTag maybe like this:
> [myusertag [item]]
>
> So I can refer to the position or the name of the column in the databases of that item.
>
> UserTag myusertag Routine <<EOR
> sub {
> my ($item, $opt) = @_;
> my $productname = $item->{name};
> my $price = $item->{price};
> ...
> my $description = $item->[3];
> }
>
> So if I extend the Database by a column, I can "automagically" refer to that column in my Usertag (if I do a "select *" offcourse).
>
> Is that possible ?
[sql-calc]$Tag->myusertag($Row)[/sql-calc]
Will work with all of the above except $item->[3].
Peter
_______________________________________________
interchange-users mailing list
interchange-users at icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
More information about the interchange-users
mailing list