Re: "'" in SQL INSERT statement

From: Dan Lyke <danlyke(at)flutterby(dot)com>
To: Alessio Bragadini <alessio(at)albourne(dot)com>
Cc: Markus Wagner <wagner(at)imsd(dot)uni-mainz(dot)de>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: "'" in SQL INSERT statement
Date: 2001-01-25 18:03:40
Message-ID: 14960.27260.603134.688706@wynand.flutterby.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jie Liang 2001-01-25 18:31:36 Re: "'" in SQL INSERT statement
Previous Message Marcos Aurélio S. da Silva 2001-01-25 17:54:19 crypt and decrypt