--
-- Type: TABLE; Owner: TM_CZ; Name: CZ_TEST_RESULT
--
 CREATE TABLE "TM_CZ"."CZ_TEST_RESULT" 
  (	"TEST_ID" NUMBER(18,0) NOT NULL ENABLE, 
"TEST_RESULT_ID" NUMBER(18,0) NOT NULL ENABLE, 
"TEST_RESULT_TEXT" VARCHAR2(2000 BYTE), 
"TEST_RESULT_NBR" NUMBER(22,0), 
"TEST_RUN_ID" NUMBER(18,0), 
"EXTERNAL_LOCATION" VARCHAR2(2000 BYTE), 
"RUN_DATE" DATE, 
"STUDY_ID" VARCHAR2(2000 BYTE)
  ) SEGMENT CREATION IMMEDIATE
 TABLESPACE "TRANSMART" ;

--
-- Type: TRIGGER; Owner: TM_CZ; Name: TRG_CZ_TEST_RESULT_ID
--
  CREATE OR REPLACE TRIGGER "TM_CZ"."TRG_CZ_TEST_RESULT_ID" 
before insert on "CZ_TEST_RESULT"    for each row
begin     if inserting then
if :NEW."TEST_RESULT_ID" is null then
select SEQ_CZ.nextval into :NEW."TEST_RESULT_ID" from dual;       end if;       end if;   end;

/
ALTER TRIGGER "TM_CZ"."TRG_CZ_TEST_RESULT_ID" ENABLE;
 
