On 26 Aug 2004, at 19:15, Darren Duncan wrote:

At 2:39 PM +0100 8/26/04, Matt Sergeant wrote:
I already support sqlite3's numeric placeholders via the standard DBI API. Switching to non-numeric placeholders will be more complex (I'll have to use a hash instead of an array to store the placeholders) but quite doable.

In case I was giving off the wrong idea, I don't mean to lose support for the positional parameters, but rather to support both posit/named concurrently.


But yes, the ability to do this would be very powerful, but hopefully very simple to implement:

        ...
        my $sth = $dbh->prepare(
                "SELECT * FROM bar ".
                "WHERE baz = :yours OR foo = :mine OR zee = :yours" );
        $sth->execute( { 'yours' => 3, 'mine' => 'hello' } );
        ...
        $sth->execute( { 'yours' => 6, 'mine' => 'goodbye' } );
        ...

Yes. Should be possible - I'll have to switch from an array storage to hash storage of the parameters, but that's not a huge deal.


For Richard's benefit though, I tested the currently documented: ":N:" style parameters and I can't compile a SQL statement with those in, which is a bit worrying (this is with sqlite 3.0.4).

Matt.


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________

Reply via email to