Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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

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


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

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-05-30 03:58 GMT
Find Nodes?
    Voting Booth?

    No recent polls found