CREATE GLOBAL TEMPORARY TABLE "PLANTA_COLUMNS" 
(	"ID" VARCHAR2(6 BYTE), 
"NAME" VARCHAR2(30 BYTE), 
"TABLE_ID" VARCHAR2(4 BYTE), 
"DB_POS" NUMBER(5,0), 
"SQL_FLAGS" NUMBER(5,0)
) ON COMMIT PRESERVE ROWS ;/

CREATE UNIQUE INDEX "PL_COL_PK" ON "PLANTA_COLUMNS" ("ID") ;/
CREATE INDEX "PLANTA_COLUMNS_BY_NAME" ON "PLANTA_COLUMNS" ("TABLE_ID", "NAME") ;/
CREATE INDEX "PLANTA_COLUMNS_NAME" ON "PLANTA_COLUMNS" ("NAME") ;/
CREATE INDEX "PLANTA_COLUMNS_SQL" ON "PLANTA_COLUMNS" ("SQL_FLAGS") ;/
CREATE INDEX "PLANTA_COLUMNS_DBPOS" ON "PLANTA_COLUMNS" ("DB_POS") ;/
CREATE INDEX "PLANTA_COLUMNS_TABLE_ID" ON "PLANTA_COLUMNS" ("TABLE_ID") ;/

ALTER TABLE "PLANTA_COLUMNS" ADD CONSTRAINT "PL_COL_PK" PRIMARY KEY ("ID") ENABLE;/
ALTER TABLE "PLANTA_COLUMNS" MODIFY ("SQL_FLAGS" NOT NULL ENABLE);/
ALTER TABLE "PLANTA_COLUMNS" MODIFY ("DB_POS" NOT NULL ENABLE);/
ALTER TABLE "PLANTA_COLUMNS" MODIFY ("TABLE_ID" NOT NULL ENABLE);/
ALTER TABLE "PLANTA_COLUMNS" MODIFY ("ID" NOT NULL ENABLE);/
