Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by monkey_boy (Priest)
on Jul 13, 2015 at 14:06 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1134507]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-16 06:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found