Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: DBI place holder for sub query problem

by dsheroh (Prior)
on Jan 02, 2008 at 16:55 UTC ( #660007=note: print w/replies, xml ) Need Help??


in reply to DBI place holder for sub query problem

I don't think it's possible to get that to work the way you want.

The way that the prepare/execute combo works is that the prepare parses the query and figures out the most efficient way to run it, then execute just plugs in a few constants to define the details. A subquery, however, isn't a constant, it's something else which has to be parsed and planned along with the main query, so I really, really doubt that it's possible to use one as a parameter.

Probably the best you're going to be able to do is move the prepare into the loop, change it to prepare_cached, and put the actual subquery into the statement you're preparing. You're going to have to do separate preparation for each subquery, but prepare_cached should at least prevent you from repeating your work when/if multiple rows have identical subqueries.

Replies are listed 'Best First'.
Re^2: DBI place holder for sub query problem
by Anonymous Monk on Jan 02, 2008 at 17:00 UTC
    Thank you for your advice, I will look into this

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://660007]
help
Chatterbox?
[afoken]: DBD::CSV has a csv_class attribute. You could subclass Text::CSV_XS to handle BOMs, e.g. through File::BOM.
[ELISHEVA]: Text::CSV_XS already can handle boms - see its detect_bom flag
[ELISHEVA]: but it seems that the DBD::CSV layer on top of it doesn't
[afoken]: Also: All other attributes that start with csv_ and are not described above will be passed to Text::CSV_XS (without the csv_ prefix).
[Discipulus]: what about a good 'ol SOPW?
[erix]: Giro d'Italia won by Dumoulin (peccato Nibali)
[ELISHEVA]: csv_detect_bom doesn't work either
[erix]: (SCNR)
[ELISHEVA]: I may have to resort to SOPW - but was hoping that this would be something simple
[erix]: I'd just remove the BOM, it is pretty simple

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2017-05-28 20:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?