Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Slightly off-topic, but: where are $run_id, $start_account and $end_account coming from, and should you perhaps be using placeholders in the query statement, and passing those variables to the $sth->execute call?

More on-topic: the question becomes "what do you need to do with these millions of rows? wouldn't it be possible to just handle each row as it comes and be done with it before fetching the next row? Rather than pushing all the rows into a single massive HoA structure, do what needs to be done with each row and forget about keeping the row data in a structure.

If you think there's some reason why all the rows need to be in a single structure, there's bound to be a way to restructure the process so that you only have to deal with a limited set of rows in memory at any one time. Apart from that, your other choice is to use one of the DBM modules to tie your hash structure to a disk file. This seems kind of weird, because it seems like you end up replicating your MSSQL database in a DBM file. But if it gets the job done... (see AnyDBM_File and the various flavors of DBM modules cited there).

Finally, a slightly irrelevant nit-pick: you don't need to do this:

unless (defined $cdr_list->{$msisdn}) { $cdr_list->{$msisdn} = []; }
It turns out that your next line of code knows how to take care of the details for creating an array-ref as the hash value when necessary, without further ado:
push @{$cdr_list->{$msisdn}}, $record; # autovivifies $cdr_list->{$msisdn} as an array ref f +or each new key

In reply to Re: Script die without warning while getting result from DBI by graff
in thread Script die without warning while getting result from DBI by wilsonch

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-19 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found