Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: selectall_hashref

by BaldPenguin (Friar)
on Jan 05, 2006 at 06:32 UTC ( #521121=note: print w/ replies, xml ) Need Help??


in reply to selectall_hashref

When I pull a query like that, I normally do it like:

my $dbh = DBI->connect('DBI:Sybase:#####', '#####', '#####', { RaiseE +rror => 1, AutoCommit => 1}); my $sql = "select Col1, Col2, Col3 from TABLE where Col4 = 1"; my $data_all = $dbh->selectall_arrayref($sql, { 'Columns' => {} } ); for my $row ( @$data_all ) { print "$_ => $row->{$_}\n" for keys %$row; }
Will that do what you are looking for.

Don
WHITEPAGES.COM | INC
Everything I've learned in life can be summed up in a small perl script!


Comment on Re: selectall_hashref
Download Code
Re^2: selectall_hashref
by mnlight (Scribe) on Jan 05, 2006 at 06:43 UTC
    I resorted back to my old way. Thank you for your help.
      That is because you must include the name of the column in uppercase letters, instead of 'Col1', use 'COL1'.
        anoonymous Monk, that made the trick !! many thanks :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2015-07-05 18:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls