Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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


Comment on Re: display database records at the console
Select or Download Code
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 romping around the Monastery: (3)
As of 2014-09-21 12:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls