2009/8/30 Martijn van Oosterhout :
> On Sun, Aug 30, 2009 at 03:22:16PM +0200, Pavel Stehule wrote:
>> Hello
>>
>> you cannot use variable as table or column name in direct query.
>>
>> look on execute statemen:
>> http://www.postgresql.org/docs/8.4/static/plpgsql-statements.html#PLPGSQL-STATEMENTS
On Sun, Aug 30, 2009 at 03:22:16PM +0200, Pavel Stehule wrote:
> Hello
>
> you cannot use variable as table or column name in direct query.
>
> look on execute statemen:
> http://www.postgresql.org/docs/8.4/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN
>
> or don't use generic
Hello
you cannot use variable as table or column name in direct query.
look on execute statemen:
http://www.postgresql.org/docs/8.4/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN
or don't use generic triggers.
regards
Pavel Stehule
2009/8/30 Stephen Cuppett :
> Using PostgreSQ
Sorry, found my answer wrt "dynamic queries", etc. Restructured trigger to
look like this:
CREATE OR REPLACE FUNCTION pdf_active_check() RETURNS trigger AS $BODY$
DECLARE
var_curs1 refcursor;
var_active BOOLEAN;
BEGIN
open var_curs1 FOR EXECUTE 'SELECT p.active FRO