[ic] [query] hashref into scratches... this should work me thinks

Peter peter at pajamian.dhs.org
Fri Dec 3 05:27:42 UTC 2010


On 03/12/10 11:45, Paul Jordan wrote:
> 
> I am not perl guru, but from what I read in the docs and archives, I
> believe this should work but I'm not getting any joy.
> 
> [query table=mytable ml=1 hashref=foo sql=|
>    SELECT  bin, bat, baz
>    FROM    mytable
>    WHERE   code = 1001
> | /]
> [calc]
>    my %bar = $Tmp->{foo};
>    while (my ($k,$v) = each %bar) { $Tag->tmp($k, $v) }
> [/calc]
> 
> results ====<br />
> Bin: [scratch bin]<br />
> Bat: [scratch bat]<br />
> Baz: [scratch baz]

[perl mytable]
	my $db = $Db{mytable};
	@{$Scratch}{qw{bin bat baz}} = $db->get_slice(1001, [qw{bin bat baz}]);
	return;
[/perl]


Peter




More information about the interchange-users mailing list