[Pdx-pm] DBI:SQLite and parameters

J. Shirley jshirley at gmail.com
Fri Oct 5 15:43:56 PDT 2007

On 10/5/07, Thomas Keller <kellert at ohsu.edu> wrote:
> I think I found it:
> Instead of a '?' (as with PostgreSQL) you use ':1', etc.
> Other than that DBI handles it in a standard way.
> thanks,
> Tom
> Thomas J Keller PhD
> kellert at ohsu.edu
> 4-2442

I think you have something weird going on -- you are talking about bind
parameters, and they are the same with SQLite -- from the DBD::SQLite docs:

    use DBI qw(:sql_types);
    $dbh->{unicode} = 1;
    my $sth = $dbh->prepare
         ("INSERT INTO mytable (blobcolumn) VALUES (?)");
    $sth->bind_param(1, $binary_data, SQL_BLOB); # binary_data will
    # be stored as-is.

Note the "bind_param" and the "?" in the ->prepare query.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/pdx-pm-list/attachments/20071005/4bcc82f5/attachment.html 

More information about the Pdx-pm-list mailing list