DB Servername hard coded in Informix Triggers?
Posted in 1998
Help!!!
In the following table definition and update trigger, Informix always expands
the table references in the trigger to include the server name. This is
causing major portability and failover issues. Our secondary server (via
Informix HDR) sees this trigger with the primary server references, so when we
fail over to the secondary, the trigger always fails because it is hard coded
to reference the primary. We've got almost a hundred triggers in production
that exibit this behavior and even moving databases between environments also
carries the original server references. Does anyone know a workaround to this
issue? Why does Informix expand these table references? There must be a
reason, but I can't for the life of me understand why....???
create table "informix".stageditem
(
stageditemid decimal(29,0) not null constraint "informix".n110_27,
commprofileid decimal(29,0)
default 0 not null constraint "informix".n104_23,
stagingprofileid decimal(29,0) not null constraint "informix".n110_28,
stagersubid decimal(29,0)
default 9048551300220312311900001000 not null constraint
"informix".n104_22,
filename varchar(255) not null constraint "informix".n110_29,
stagingstatus char(1) not null constraint "informix".n110_30,
stagerid decimal(29,0),
whenstaged datetime year to second,
lastupdatedate datetime year to second
default current year to second not null constraint "informix".n100_20,
lastupdateby varchar(15)
default user not null constraint "informix".n100_21,
primary key (stageditemid) constraint "informix".stageditem_pk
);
revoke all on "informix".stageditem from "public";
alter table "informix".stageditem add constraint (foreign key (stagingstatus)
references "informix".stagingstatusref constraint
"informix".stagref_to_stag);
create trigger "informix".stgitmupd update of stageditemid,stagingprofileid,
filename,stagingstatus,stagerid,whenstaged on "informix".stageditem
referencing old as pre_upd
for each row
(
update "informix".stageditem set
ocs_stage@dcibdb2w_tcp:"informix".stageditem.lastupdatedate
= CURRENT year to second
,ocs_stage@dcibdb2w_tcp:"informix".stageditem.lastupdateby
= USER where (stageditemid = pre_upd.stageditemid
) );
Thanks,
/| /|
-Mike || ,,,// ||
|| ( O o ) ||
+----------------))-----------------oOOo-(_)-oOOo----))---------------+
| Mike Adams OrderTrust |
| Manager, Database Department 900 Chelmsford Street |
| OrderTrust Operations Division Lowell MA 01851-8207 |
| mailto:m_adams@ordertrust.net .oooO Phone: 978.551.5021 |
| http://www.ordertrust.net ( ) Oooo. Fax: 978.551.5050 |
+----------------------------------\\ (----( )-----------------------+
\\_) ) /
(_/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own