pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: wieck@debis.com
To: eric@netsystems.fr
Cc: rison@biochemistry.ucl.ac.uk
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] INSERT and SELECT
Date: Fri, 10 Dec 1999 17:57:57 +0100 (MET)
Message-ID: <m11wTMj-0003kGC@orion.SAPserv.Hamburg.dsh.de> (raw)
In-Reply-To: <87emcuu4f4.fsf@venus.fondation>

>
> Stuart Rison <rison@biochemistry.ucl.ac.uk> writes:
> > INSERT INTO table VALUES SELECT oid, 'test' FROM membre WHERE
> > email=3D"toto@toto.com";
> I've tried it, but it doesn't work too ("paser error near or at select"),
> even if I replace " by '.

    Because  VALUES  and  SELECT  are  mutually exclusive at that
    point.

    Just do INSERT INTO table SELECT ...

    or INSERT INTO TABLE (attrib, ...) SELECT ...

    and the parser should be happy.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #





view thread (9+ messages)  latest in thread

Message-ID: <m11wTMj-0003kGC@orion.SAPserv.Hamburg.dsh.de>
Permalink:  ../m11wTMj-0003kGC@orion.SAPserv.Hamburg.dsh.de/
Also on:    postgresql.org/message-id/m11wTMj-0003kGC@orion.SAPserv.Hamburg.dsh.de

 · 

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: wieck@debis.com, eric@netsystems.fr, rison@biochemistry.ucl.ac.uk
  Subject: Re: [SQL] INSERT and SELECT
  In-Reply-To: <m11wTMj-0003kGC@orion.SAPserv.Hamburg.dsh.de>
  References: <87emcuu4f4.fsf@venus.fondation> <m11wTMj-0003kGC@orion.SAPserv.Hamburg.dsh.de>

* 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