Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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.

--
Regards
- 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2016-06-26 19:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (331 votes). Check out past polls.