Re: SQL works but same function is confused

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bui, Michelle P" <michelle(dot)p(dot)bui(at)boeing(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: SQL works but same function is confused
Date: 2014-04-02 02:20:30
Message-ID: 29526.1396405230@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Bui, Michelle P" <michelle(dot)p(dot)bui(at)boeing(dot)com> writes:
> I have this query that when executed as a SQL statement, it works perfect!

OK ...

> I used <<block>> before Declare section and try using block.v_status but
> this is not allowed (has syntax error).

That should work (in the sense of not getting a syntax error), but since
you've not shown us exactly what you wrote, it's impossible to say what
you did wrong. However, that's mostly beside the point, because ...

> When I use #variable_conflict use_variable, there is no error anymore, but the resulted Status field is null. Seemed like Postgresql does not assign the v_status as we wish.

According to the above, the behavior you want is use_column. Why are you
trying to get it to use the variable when that's not what you want?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-04-02 02:35:35 Re: SQL works but same function is confused
Previous Message Bui, Michelle P 2014-04-02 01:44:41 Re: SQL works but same function is confused