Re-using DBIx ResultSet with different parametersby MattLG (Sexton)
|on Oct 13, 2016 at 10:40 UTC||Need Help??|
MattLG has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to work out a way of executing a ResultSet query mutiple times with a different parameter, but despite searching everywhere, I can't find anything that covers the subject.
I have a reasonably complex query:
But I want to get the results multiple times in a loop:
I'd rather not have the query re-prepared multiple times when the only thing that has changed is one piece of data. Is DBIx clever enough to realise that it has created the same underlying query twice and not re-prepare it?
I'm assuming no.
If not, how could I do something like this?
The only reference to this sort of thing that I can find is by creating a ResultSource::View class, which seems like overkill just for the sake of some bind parameters.