Re: What am I doing wrong here?

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

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.)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message stan 2019-12-26 14:59:06 Re: What am I doing wrong here?
Previous Message Jayadevan M 2019-12-26 14:04:28 Re: What am I doing wrong here?