Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Template::Toolkit - How do i access alias-based results?

by monkey_boy (Priest)
on Jul 13, 2015 at 14:06 UTC ( #1134507=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1134507]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2021-06-15 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (72 votes). Check out past polls.

    Notices?