| From: | Alban Hertroys <haramrae(at)gmail(dot)com> |
|---|---|
| To: | "Bob Pawley" <rjpawley(at)shaw(dot)ca> |
| Cc: | "Postgresql" <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: Using Insert with case |
| Date: | 2012-08-07 22:40:01 |
| Message-ID: | E2F2D9FE-E172-4F8E-9494-08127E9977EA@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
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)
> and bob.node.node_id = 415
> and pipe.id = 1)
>
> I am attempting to use the above. However, with or without the enclosing brackets I get a syntax error on the word into.
Is that somehow different from this?
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
and somevariable = 2
Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bob Pawley | 2012-08-07 22:45:06 | Re: Using Insert with case |
| Previous Message | Chris Angelico | 2012-08-07 22:34:13 | Re: Using Insert with case |