Coming from SQL Server, I am learning some Oracle syntax.
This is my table DDL
CREATE TABLE "CDR"."EXTDL_REPORTSETS"
(
"ID" NUMBER(38,0) NOT NULL ENABLE,
"SHORTNAME" NUMBER(38,0) NOT NULL ENABLE,
"DESCRIPTION" NUMBER(38,0) NOT NULL ENABLE,
"ASOFSTARTDATETIME" NUMBER(38,0) NOT NULL ENABLE,
"ASOFENDDATETIME" NUMBER(38,0) NOT NULL ENABLE,
CONSTRAINT "PK_EXTDL_REPORTSETS" PRIMARY KEY ("ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CDR_DATA" ENABLE
)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
(
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
)
TABLESPACE "CDR_DATA" ;
I want to default ASOFSTARTDATETIME to SysDate. How do I set a default constraint in PL/SQL?
EDIT
The datatypes had gotten messed up, so I corrected it.
CREATE TABLE CDR.ExtDL_Reportsets(
Id NUMBER(38, 0) NOT NULL,
ShortName VARCHAR2(255) NOT NULL,
Description VARCHAR2(500) NOT NULL,
AsOfStartDateTime DATE NOT NULL,
AsOfEndDateTime DATE,
CONSTRAINT PK_ExtDL_Reportsets PRIMARY KEY (Id)
)
;