pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dan Lyke <danlyke@flutterby.com>
To: Alessio Bragadini <alessio@albourne.com>
Cc: 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 10:03:40 -0800 (PST)
Message-ID: <14960.27260.603134.688706@wynand.flutterby.com> (raw)
In-Reply-To: <3A700060.3FD31A6D@albourne.com>
References: <3A6FFC12.F5ABA71@imsd.uni-mainz.de>
	<3A700060.3FD31A6D@albourne.com>

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



view thread (7+ messages)  latest in thread

Message-ID: <14960.27260.603134.688706@wynand.flutterby.com>
Permalink:  ../14960.27260.603134.688706@wynand.flutterby.com/
Also on:    postgresql.org/message-id/14960.27260.603134.688706@wynand.flutterby.com

 · 

reply

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: danlyke@flutterby.com, alessio@albourne.com, wagner@imsd.uni-mainz.de
  Subject: Re: "'" in SQL INSERT statement
  In-Reply-To: <14960.27260.603134.688706@wynand.flutterby.com>
  References: <3A6FFC12.F5ABA71@imsd.uni-mainz.de> <3A700060.3FD31A6D@albourne.com> <14960.27260.603134.688706@wynand.flutterby.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