in reply to Re: Postprocess Template Toolkit DBI Call
in thread Postprocess Template Toolkit DBI Call

Apologies for not being clear.
What I'd like to do is push values returned from a DBI query within Template into a hash and then process that hash.
I am unsure on how to do this.
Thanks,
Ap
  • Comment on Re^2: Postprocess Template Toolkit DBI Call

Replies are listed 'Best First'.
Re^3: Postprocess Template Toolkit DBI Call
by aptom (Novice) on Aug 10, 2010 at 05:37 UTC
    Taken me a few days but think I've nutter it out.
    [% sql_entries = query.execute() %] [% terms = {} %] [% FOREACH row IN sql_entries; terms.${row.LOCATION} = "${row.LOCID}"; END %] [% FOREACH row IN terms.keys %] [% row %]: [% terms.$row %] [% END %]

    Note: LOCATION and LOCID are columns returned from the query