Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

char size

by Anonymous Monk
on Sep 07, 2001 at 04:01 UTC ( #110797=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I make a program to extract some data from a Mysql db of more than 15000 records...I have to set the size of the characters in MS DOS more more small... Is there someone that can help me? Thanks

Comment on char size
Re: char size
by synapse0 (Pilgrim) on Sep 07, 2001 at 12:13 UTC
    Not sure if I understand you, to me it sounds like you're running a query and you get back soo much data that it all doesn't fit on your dos screen.. So to compensate, you drop the char size to try and fit more in.. is that right??
    Well, if so, uhmm.. is there any perl involved at all? or are you just running the query from within mysql? If you're dealing with the latter, then you're in the wrong place, try a mysql forum somewhere (or the docs at www.mysql.com).. If you're using Perl, then you can do something like:
    $x = 1; while(@data = $sth->fetchrow_array) { print join(' ', @data) . "\n"; unless ($x % $max_lines) { print "\nPress a key to continue.\n"; <STDIN>; } $x++; }
    The main thing there is the % (modulous operator) which will return the remainder of $x divided by $maxlines, which is true everytime $x has been incremented $maxlines times, so we get a pause in output as the script waits for you to press enter, allowing you to review what's been printed so far.
    -Syn0
Re: char size
by dondelelcaro (Monk) on Sep 07, 2001 at 16:10 UTC
    As synapse0 suggests, you really should be looking for the answer on http://www.mysql.com, but beyond that, if what synapse0 correctly mentions isn't what you're looking for, you might also want to examine the LIMIT part of a SELECT statement.

    In addition, if you're dealing with a large number of records, mysql dbname --exec='SELECT * FROM bleh WHERE blah' > puke.txt or it's DOS equivalent is your friend.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2014-09-19 01:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (129 votes), past polls