Re: SQL works but same function is confused - Mailing list pgsql-general

From Tom Lane
Subject Re: SQL works but same function is confused
Date
Msg-id 29526.1396405230@sss.pgh.pa.us
Whole thread Raw
In response to SQL works but same function is confused  ("Bui, Michelle P" <michelle.p.bui@boeing.com>)
Responses Re: SQL works but same function is confused  ("Bui, Michelle P" <michelle.p.bui@boeing.com>)
List pgsql-general
"Bui, Michelle P" <michelle.p.bui@boeing.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
likePostgresql 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


pgsql-general by date:

Previous
From: "Bui, Michelle P"
Date:
Subject: Re: SQL works but same function is confused
Next
From: Adrian Klaver
Date:
Subject: Re: SQL works but same function is confused