Hi,

I have a situation where I need to dereference the fields in the NEW record
within a trigger.

I know the standard way where NEW.fieldname where fieldname is known before
hand. What if fieldname is a text variable?

Say,

--------------------------

DECLARE

        fldname text;

begin
        fldname = 'name';


        raise exception '% has value %', fldname, NEW.fldname; -- is this possible?

        return NEW;
end;

--------------------------

is there a way such as NEW.fldname, or NEW.%fldname, or NEW.$fldname?


Any help appreciated,

Thanks,

Conrad


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to