Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: display database records at the console

by samarzone (Pilgrim)
on Dec 30, 2010 at 15:32 UTC ( #879817=note: print w/replies, xml ) Need Help??

in reply to display database records at the console

Why bother? Just use mysql client with -e option

If you are desperate to do it in Perl just for displaying record on console you can use system or backticks (``) with mysql client and -e option as a shell command

Even if you want to do it through DBI you need not write a separate format for each query. You can loop over column names for header row. Column names can be found through $sth->{NAME} . I hope you very well know how to get the field values from the record-set returned.

- Samar

Replies are listed 'Best First'.
Re^2: display database records at the console
by Anonymous Monk on Dec 30, 2010 at 17:49 UTC
    thanks for both comments

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2016-10-25 02:40 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (313 votes). Check out past polls.