     ADD CONSTRAINT KREW_RTE_BRCH_ST_TP1
 PRIMARY KEY (RTE_BRCH_ST_ID)
 /
-CREATE INDEX KREW_RTE_BRCH_ST_TI1
-  ON KREW_RTE_BRCH_ST_T
+CREATE INDEX KREW_RTE_BRCH_ST_TI1 
+  ON KREW_RTE_BRCH_ST_T 
   (RTE_BRCH_ID, KEY_CD)
 /
-CREATE INDEX KREW_RTE_BRCH_ST_TI2
-  ON KREW_RTE_BRCH_ST_T
+CREATE INDEX KREW_RTE_BRCH_ST_TI2 
+  ON KREW_RTE_BRCH_ST_T 
   (RTE_BRCH_ID)
 /
-CREATE INDEX KREW_RTE_BRCH_ST_TI3
-  ON KREW_RTE_BRCH_ST_T
+CREATE INDEX KREW_RTE_BRCH_ST_TI3 
+  ON KREW_RTE_BRCH_ST_T 
   (KEY_CD, VAL)
 /
 INSERT INTO KREW_RTE_BRCH_ST_T
 (RTE_BRCH_ST_ID, RTE_BRCH_ID, KEY_CD, VAL, VER_NBR)
-SELECT
+SELECT 
 CAST(RTE_BRCH_ST_ID as VARCHAR2(40)), CAST(RTE_BRCH_ID as VARCHAR2(40)), KEY_CD, VAL, VER_NBR
 FROM TEMP_KREW_RTE_BRCH_ST_T
 /

-----------------------------------------------------------------------------
-- KREW_RTE_NODE_T
-----------------------------------------------------------------------------
DECLARE
c NUMBER;
BEGIN
select count(*) into c from all_constraints where CONSTRAINT_NAME = 'KREW_RTE_NODE_TP1' ;
IF c>0 THEN
EXECUTE IMMEDIATE 'ALTER TABLE KREW_RTE_NODE_T DROP CONSTRAINT KREW_RTE_NODE_TP1';
ELSE
DBMS_OUTPUT.PUT_LINE('KREW_RTE_NODE_TP1 does not exist, so not running statement to change/drop it.');
END IF;
END;
/
DECLARE
c NUMBER;
BEGIN
select count(*) into c from all_indexes where INDEX_NAME = 'KREW_RTE_NODE_TI1' ;
IF c>0 THEN
EXECUTE IMMEDIATE 'DROP INDEX KREW_RTE_NODE_TI1';
ELSE
DBMS_OUTPUT.PUT_LINE('KREW_RTE_NODE_TI1 does not exist, so not running statement to change/drop it.');
END IF;
END;
/
DECLARE
c NUMBER;
BEGIN
select count(*) into c from all_indexes where INDEX_NAME = 'KREW_RTE_NODE_TI2' ;
IF c>0 THEN
EXECUTE IMMEDIATE 'DROP INDEX KREW_RTE_NODE_TI2';
ELSE
DBMS_OUTPUT.PUT_LINE('KREW_RTE_NODE_TI2 does not exist, so not running statement to change/drop it.');
END IF;
END;
/
DECLARE
c NUMBER;
BEGIN
select count(*) into c from all_indexes where INDEX_NAME = 'KREW_RTE_NODE_TI3' ;
IF c>0 THEN
EXECUTE IMMEDIATE 'DROP INDEX KREW_RTE_NODE_TI3';
ELSE
DBMS_OUTPUT.PUT_LINE('KREW_RTE_NODE_TI3 does not exist, so not running statement to change/drop it.');
END IF;
END;
/
DECLARE
c NUMBER;
BEGIN
select count(*) into c from all_indexes where INDEX_NAME = 'KREW_RTE_NODE_TI4' ;
IF c>0 THEN
EXECUTE IMMEDIATE 'DROP INDEX KREW_RTE_NODE_TI4';
ELSE
DBMS_OUTPUT.PUT_LINE('KREW_RTE_NODE_TI4 does not exist, so not running statement to change/drop it.');
END IF;
END;
/
ALTER TABLE KREW_RTE_NODE_T RENAME TO TEMP_KREW_RTE_NODE_T
/

-----------------------------------------------------------------------------
-- KREW_DOC_LNK_T
-----------------------------------------------------------------------------
ALTER TABLE KREW_DOC_LNK_T DROP CONSTRAINT KREW_DOC_LNK_TP1
/
DROP INDEX KREW_DOC_LNK_TI1
/
ALTER TABLE KREW_DOC_LNK_T RENAME TO TEMP_KREW_DOC_LNK_T
/
