http://qs321.pair.com?node_id=1134507


in reply to Template::Toolkit - How do i access alias-based results?

Try this:
[% USE oracleDB = DBI("dbi:Oracle:xe", "LP", "lpdba") %] <html> <body> [% query = oracleDB.prepare(" SELECT u.name, u.adress, u.idontknow FROM user u, anothertable t, athirdtable d WHERE u.id = t.user AND t.id = d.something ORDER BY u.name DESC") %] [% USE Dumper %] <pre> [% Dumper.dump(query.execute()) %] </pre> </body> </html>



This is not a Signature...

Replies are listed 'Best First'.
Re^2: Template::Toolkit - How do i access alias-based results?
by Yaerox (Scribe) on Jul 13, 2015 at 14:10 UTC
    Output:
    $VAR1 = bless( { 'MAX' => -1, '_STH' => bless( { '_STH' => bless( {}, 'DBI::st' ) }, 'Template::Plugin::DBI::Query' ), 'SIZE' => 0 }, 'Template::Plugin::DBI::Iterator' );
      Sorry, try this then ;) Not sure if its 'IN' or '=' in this FOR loop, try both if needed.
      [% USE oracleDB = DBI("dbi:Oracle:xe", "LP", "lpdba") %] <html> <body> [% query = oracleDB.prepare(" SELECT u.name, u.adress, u.idontknow FROM user u, anothertable t, athirdtable d WHERE u.id = t.user AND t.id = d.something ORDER BY u.name DESC") %] [% USE Dumper %] [% FOREACH res IN query.execute() %] <pre> [% Dumper.dump(res) %] </pre> [% END %] </body> </html>


      This is not a Signature...