Re: [SQL] INSERT and SELECT

From: wieck(at)debis(dot)com (Jan Wieck)
To: eric(at)netsystems(dot)fr (Eric BARROCA)
Cc: rison(at)biochemistry(dot)ucl(dot)ac(dot)uk, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] INSERT and SELECT
Date: 1999-12-10 16:57:57
Message-ID: m11wTMj-0003kGC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
> Stuart Rison <rison(at)biochemistry(dot)ucl(dot)ac(dot)uk> writes:
> > INSERT INTO table VALUES SELECT oid, 'test' FROM membre WHERE
> > email=3D"toto(at)toto(dot)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(at)debis(dot)com (Jan Wieck) #

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message neko 1999-12-10 17:12:57 Re: [SQL] INSERT and SELECT
Previous Message Ross J. Reedstrom 1999-12-10 16:54:40 Re: [SQL] INSERT and SELECT