in reply to Postprocess Template Toolkit DBI Call

Yes, I'm sure someone has done something similar before...

I'm not sure I understand the reason for your posting. Are you having a problem or an error of some type? Are you looking for a better way to do it? Let us know what kind of response you're hoping for, and we might be able to help.
  • Comment on Re: Postprocess Template Toolkit DBI Call

Replies are listed 'Best First'.
Re^2: Postprocess Template Toolkit DBI Call
by aptom (Novice) on Aug 06, 2010 at 00:00 UTC
    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
      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