Re: What am I doing wrong here?

From: stan <stanb(at)panix(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: What am I doing wrong here?
Date: 2019-12-26 15:00:57
Message-ID: 20191226150057.GC21962@panix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Thu, Dec 26, 2019 at 09:06:03AM -0500, Tom Lane wrote:
> stan <stanb(at)panix(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message stan 2019-12-26 16:33:20 Not my day :-( Another syntax error
Previous Message stan 2019-12-26 15:00:02 Re: What am I doing wrong here?