Re: "'" in SQL INSERT statement - Mailing list pgsql-sql

From Dan Lyke
Subject Re: "'" in SQL INSERT statement
Date
Msg-id 14960.27260.603134.688706@wynand.flutterby.com
Whole thread Raw
In response to Re: "'" in SQL INSERT statement  (Alessio Bragadini <alessio@albourne.com>)
List pgsql-sql
Alessio Bragadini writes:
> Markus Wagner wrote:
> > I have some data that I wish to transfer into a database using perl/DBI.
> 
> If you use Perl DBI you should issue statements like
> $dbh->do ('INSERT INTO table (field1, field2) VALUES (?,?)',
>     undef, $value1, $value2);

$dbh->quote() also puts in the appropriate escapes, ala:
  $dbh->do('INSERT INTO TABLE (field) VALUES ('.$dbh->quote($value).')');

Dan


pgsql-sql by date:

Previous
From: Keith Perry
Date:
Subject: Re: Inserting and incrementing with MAX aggregate
Next
From: Jie Liang
Date:
Subject: Re: "'" in SQL INSERT statement