Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Passing DBI resultset to function

by bfdi533 (Friar)
on Dec 15, 2009 at 18:09 UTC ( [id://812914]=note: print w/replies, xml ) Need Help??


in reply to Passing DBI resultset to function

Seems like you have several options.

You could:

  • parse the results at the same time by the function
    while (my $rad = $sth->fetchrow_hashref()) { $a_variable = $rad->{'Some_column'}; &DoSomeTreatment($rad); }
  • re-run the query from the function
  • store the results and pass them to the function

Replies are listed 'Best First'.
Re^2: Passing DBI resultset to function
by DreamT (Pilgrim) on Dec 17, 2009 at 11:26 UTC
    Thank you. My goal is to operate on the resultset, rather than having to re-run the query. I guess that would do the trick?
Re^2: Passing DBI resultset to function
by afoken (Chancellor) on Dec 18, 2009 at 00:33 UTC
    &DoSomeTreatment($rad);

    Is there any reason why you propagate the obsolete perl4 syntax for function calls?

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found