.com Solutions Inc. - logo  
Products - Header Buttons
.
Repgen bullet item 7b Installgen bullet item 7b FmPro Migratorbullet item 7b CGIScripter
.
.
.

.
.

Products - Title Graphic

Repgen Features and Benefits

Repgen Demo Available for download...

.

-- script name: idtriggers
-- Features: Creates primary key "ID" triggers for all replicated tables.
-- NOTE: This file needs to be run at each master site.
-- Copyright 2002 by .com Solutions Inc.
-- This output file was created by Repgen version 2.2.4 on Fri May 31 13:29:24 2002. By .com Solutions Inc. www.dotcomsolutionsinc.net

-- ************** customer_repgroup
-- ########## customers
CREATE OR REPLACE TRIGGER WIDGETS1.CUSTOMERS_GET_ID
BEFORE INSERT ON WIDGETS1.CUSTOMERS
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
new_id INTEGER;
BEGIN
IF NOT DBMS_REPUTIL.FROM_REMOTE AND :NEW.ID IS NULL THEN
-- only execute this code if trigger is NOT fired by replication
-- and is NOT being copied by sql commands

-- get ID from sequence
SELECT WIDGETS1.customers_seq.nextval
INTO new_id
FROM DUAL;

:NEW.ID := new_id;

-- fill the date modified column for replication conflict resolution
:NEW.DATE_MODIFIED := SYSDATE;
-- fill the site id column for replication conflict resolution
:NEW.SITE_NAME := DBMS_REPUTIL.GLOBAL_NAME;
END IF;
END;
-- END PL/SQL BLOCK ----------------------------------
/

-- ########## addresses
CREATE OR REPLACE TRIGGER WIDGETS1.ADDRESSES_GET_ID
BEFORE INSERT ON WIDGETS1.ADDRESSES
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
new_id INTEGER;
BEGIN
IF NOT DBMS_REPUTIL.FROM_REMOTE AND :NEW.ID IS NULL THEN
-- only execute this code if trigger is NOT fired by replication
-- and is NOT being copied by sql commands

-- get ID from sequence
SELECT WIDGETS1.addresses_seq.nextval
INTO new_id
FROM DUAL;

:NEW.ID := new_id;

-- fill the date modified column for replication conflict resolution
:NEW.DATE_UPDATED := SYSDATE;
-- fill the site id column for replication conflict resolution
:NEW.SITE_ID := DBMS_REPUTIL.GLOBAL_NAME;
END IF;
END;
-- END PL/SQL BLOCK ----------------------------------
/


-- ************** static_tables_repgroup
-- ########## state_province
CREATE OR REPLACE TRIGGER WIDGETS1.STATE_PROVINCE_GET_ID
BEFORE INSERT ON WIDGETS1.STATE_PROVINCE
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
new_id INTEGER;
BEGIN
IF NOT DBMS_REPUTIL.FROM_REMOTE AND :NEW.ID IS NULL THEN
-- only execute this code if trigger is NOT fired by replication
-- and is NOT being copied by sql commands

-- get ID from sequence
SELECT WIDGETS1.state_province_seq.nextval
INTO new_id
FROM DUAL;

:NEW.ID := new_id;

-- fill the date modified column for replication conflict resolution
:NEW.DATE_MODIFIED := SYSDATE;
-- fill the site id column for replication conflict resolution
:NEW.SITE_NAME := DBMS_REPUTIL.GLOBAL_NAME;
END IF;
END;
-- END PL/SQL BLOCK ----------------------------------
/

-- ########## country
CREATE OR REPLACE TRIGGER WIDGETS1.COUNTRY_GET_ID
BEFORE INSERT ON WIDGETS1.COUNTRY
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
new_id INTEGER;
BEGIN
IF NOT DBMS_REPUTIL.FROM_REMOTE AND :NEW.ID IS NULL THEN
-- only execute this code if trigger is NOT fired by replication
-- and is NOT being copied by sql commands

-- get ID from sequence
SELECT WIDGETS1.country_seq.nextval
INTO new_id
FROM DUAL;

:NEW.ID := new_id;

-- fill the date modified column for replication conflict resolution
:NEW.DATE_MODIFIED := SYSDATE;
-- fill the site id column for replication conflict resolution
:NEW.SITE_ID := DBMS_REPUTIL.GLOBAL_NAME;
END IF;
END;
-- END PL/SQL BLOCK ----------------------------------
/




.

hline

. .

.

. .
 

Home | Products | Services | Downloads | Order | Support | Contact

Legal Notices

.
.   .
.
Home Products Services Downloads Order Support Contact