Re: missing FROM-clause entry for table bbbb

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Abhra Kar <abhra(dot)kar(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: missing FROM-clause entry for table bbbb
Date: 2018-01-16 14:24:42
Message-ID: CAKJS1f8SCgy5JCc-mwuV8aq4+Meg_aA53k4=e4UYrJOpsWyH2A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

On 17 January 2018 at 00:36, Abhra Kar <abhra(dot)kar(at)gmail(dot)com> wrote:
> insert into aaaa (id, groupid, ele_id, ro_element_id) ")
> select bbbb.nextval, :groupid, gosp.neteleid, gosp.hodev
> from net_ele gos, net_gos_prop gosp "
> where gos.eid in ( :eids ) and gos.id = gosp.net_element_id and
> gos.id not in (select ealjs.element_id from aaaa ealjs where
> ealjs.groupid = :groupid)
>
> If I run this it gives error for ":".If I remove : then I will get error
> like missing FROM-clause entry for table bbbb.

bbbb.nextval looks like some sort of Oracle syntax to get the nextval
from a sequence. In PostgreSQL you'd do nextval('bbbb'); Assuming you
have a sequence named "bbbb"

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Neto pr 2018-01-16 14:47:46 SSD filesystem aligned to DBMS
Previous Message David G. Johnston 2018-01-16 14:10:58 Re: missing FROM-clause entry for table bbbb

Browse pgsql-novice by date

  From Date Subject
Next Message Purav Chovatia 2018-01-16 14:50:55 symlinks in pg_xlog to wal of previous timeline, after a failover
Previous Message David G. Johnston 2018-01-16 14:10:58 Re: missing FROM-clause entry for table bbbb