From: Alessio Bragadini <alessio@albourne.com>
To: Markus Wagner <wagner@imsd.uni-mainz.de>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: "'" in SQL INSERT statement
Date: Thu, 25 Jan 2001 12:30:56 +0200
Message-ID: <3A700060.3FD31A6D@albourne.com> (raw)
References: <3A6FFC12.F5ABA71@imsd.uni-mainz.de>
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);
This binding takes care of quoting and escapes all characters that may
cause problems in the database backed (e.g. "that's" becomes "that''s"
etc.)
There is a DBI mailing list where you can find more info and support:
see <http://www.isc.org/dbi-lists.html;
--
Alessio F. Bragadini alessio@albourne.com
APL Financial Services http://village.albourne.com
Nicosia, Cyprus phone: +357-2-755750
"It is more complicated than you think"
-- The Eighth Networking Truth from RFC 1925
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: alessio@albourne.com, wagner@imsd.uni-mainz.de
Subject: Re: "'" in SQL INSERT statement
In-Reply-To: <3A700060.3FD31A6D@albourne.com>
References: <3A6FFC12.F5ABA71@imsd.uni-mainz.de> <3A700060.3FD31A6D@albourne.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox