Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2018-03-20 06:35 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (248 votes). Check out past polls.