From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Bob Pawley
Sent: Tuesday, August 07, 2012 6:26 PM
To: Postgresql
Subject: [GENERAL] Using Insert with case
Hi
select
case when somevariable = 2
then (insert into pipe (line)
select
] Using Insert with case
On 8 Aug 2012, at 24:26, Bob Pawley wrote:
Hi
select
case when somevariable = 2
then (insert into pipe (line)
select bob.edge_data.edge_id
from bob.edge_data, bob.node, pipe
where st_intersects(st_startpoint(bob.edge_data.geom),
bob.node.geom
On 8 Aug 2012, at 24:26, Bob Pawley wrote:
> Hi
>
> select
> case when somevariable = 2
> then (insert into pipe (line)
> select bob.edge_data.edge_id
> from bob.edge_data, bob.node, pipe
> where st_intersects(st_startpoint(bob.edge_data.geom), bob.node.geom)
>
On Wed, Aug 8, 2012 at 8:26 AM, Bob Pawley wrote:
> Hi
>
> select
> case when somevariable = 2
> then (insert into pipe (line) ...
>
> I am attempting to use the above. However, with or without the enclosing
> brackets I get a syntax error on the word into.
Utterly untested, but does it work
Hi
select
case when somevariable = 2
then (insert into pipe (line)
select bob.edge_data.edge_id
from bob.edge_data, bob.node, pipe
where st_intersects(st_startpoint(bob.edge_data.geom), bob.node.geom)
and bob.node.node_id = 415
and pipe.id = 1)
I am att