Re: What am I doing wrong here? - Mailing list pgsql-general

From stan
Subject Re: What am I doing wrong here?
Date
Msg-id 20191226150057.GC21962@panix.com
Whole thread Raw
In response to Re: What am I doing wrong here?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Thu, Dec 26, 2019 at 09:06:03AM -0500, Tom Lane wrote:
> stan <stanb@panix.com> writes:
> > When I try to insert this function I get an error on the following line:
> > _bom_name_key  = ( SELECT
> > I actually pretty much get a syntax error whatever is at this line.
> > Can someone please explain what I am doing wrong?
> 
> I think you're misunderstanding where to put the WITH.  That's just
> part of the SQL statement as far as plpgsql is concerned, so what
> you need to do to use a WITH clause in a variable assignment is
> to write
> 
>     variable := WITH ... SELECT ... ;
> 
> (At least, I think that will work; what you're doing definitely
> won't.)

Thanks, that was my mistake.
-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
                        -- Benjamin Franklin



pgsql-general by date:

Previous
From: stan
Date:
Subject: Re: What am I doing wrong here?
Next
From: stan
Date:
Subject: Not my day :-( Another syntax error