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

From Alessio Bragadini
Subject Re: "'" in SQL INSERT statement
Date
Msg-id 3A700060.3FD31A6D@albourne.com
Whole thread Raw
In response to "'" in SQL INSERT statement  (Markus Wagner <wagner@imsd.uni-mainz.de>)
Responses Re: "'" in SQL INSERT statement  (Dan Lyke <danlyke@flutterby.com>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Re: "'" in SQL INSERT statement
Next
From: "Brett W. McCoy"
Date:
Subject: Re: "'" in SQL INSERT statement