Using Insert with case - Mailing list pgsql-general

From Bob Pawley
Subject Using Insert with case
Date
Msg-id 5ACA3D3C33874B49A0D9A773C5488FF9@BobPC
Whole thread Raw
Responses Re: Using Insert with case
Re: Using Insert with case
Re: Using Insert with case
List pgsql-general
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.
 
Help will be appreciated.
 
Bob

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: JSON in 9.2: limitations
Next
From: Chris Angelico
Date:
Subject: Re: Using Insert with case