CREATE GLOBAL TEMPORARY TABLE "PLANTA_RELATIONS" 
(	"TABLE_ID" VARCHAR2(4 BYTE), 
"R_TABLE_ID" VARCHAR2(4 BYTE), 
"RELATION" VARCHAR2(4 BYTE), 
"RECURSION" NUMBER(5,0), 
"NAME" VARCHAR2(16 BYTE), 
"FIRST_KEY_DI" VARCHAR2(6 BYTE), 
"LAST_KEY_DI" VARCHAR2(6 BYTE), 
"FIRST_DB_POS" NUMBER(5,0), 
"LAST_DB_POS" NUMBER(5,0)
) ON COMMIT PRESERVE ROWS ;/

CREATE UNIQUE INDEX "PL_REL_PK" ON "PLANTA_RELATIONS" ("TABLE_ID", "R_TABLE_ID", "FIRST_KEY_DI") ;/

ALTER TABLE "PLANTA_RELATIONS" ADD CONSTRAINT "PL_REL_PK" PRIMARY KEY ("TABLE_ID", "R_TABLE_ID", "FIRST_KEY_DI") ENABLE;/
ALTER TABLE "PLANTA_RELATIONS" MODIFY ("LAST_DB_POS" NOT NULL ENABLE);/
ALTER TABLE "PLANTA_RELATIONS" MODIFY ("FIRST_DB_POS" NOT NULL ENABLE);/
ALTER TABLE "PLANTA_RELATIONS" MODIFY ("LAST_KEY_DI" NOT NULL ENABLE);/
ALTER TABLE "PLANTA_RELATIONS" MODIFY ("FIRST_KEY_DI" NOT NULL ENABLE);/
ALTER TABLE "PLANTA_RELATIONS" MODIFY ("RECURSION" NOT NULL ENABLE);/
ALTER TABLE "PLANTA_RELATIONS" MODIFY ("RELATION" NOT NULL ENABLE);/
ALTER TABLE "PLANTA_RELATIONS" MODIFY ("R_TABLE_ID" NOT NULL ENABLE);/
ALTER TABLE "PLANTA_RELATIONS" MODIFY ("TABLE_ID" NOT NULL ENABLE);/