referencing an unknown variable in the NEW record in a trigger

Поиск
Список
Период
Сортировка
Искать

referencing an unknown variable in the NEW record in a trigger

От:
"Conrad Vermeulen" <conrad@fastforward.za.net>
Дата:
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

FAQ