[ic] assign Query-Result-Row to Usertag

Ingo Buse ingo.buse at bnc.info
Thu Oct 22 14:50:39 UTC 2009


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 ...."]

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 ?


More information about the interchange-users mailing list