Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 989747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:50:30+00:00 2026-05-16T05:50:30+00:00

Coming from SQL Server, I am learning some Oracle syntax. This is my table

  • 0

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)
)
;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T05:50:31+00:00Added an answer on May 16, 2026 at 5:50 am

    Use:

    ALTER TABLE EXTDL_REPORTSETS
         MODIFY last_ASOFSTARTDATETIME DATE DEFAULT SYSDATE
    

    I’m having trouble digging up the 10g reference documentation – this is for 11g.

    If you want to do it in the CREATE TABLE statement:

    CREATE TABLE "CDR"."EXTDL_REPORTSETS" (
      "ID"                NUMBER(38,0) NOT NULL ENABLE,
      "SHORTNAME"         VARCHAR2(255) NOT NULL ENABLE,
      "DESCRIPTION"       VARCHAR2(500) NOT NULL ENABLE,
      "ASOFSTARTDATETIME" DATE DEFAULT SYSDATE NOT NULL ENABLE,
      "ASOFENDDATETIME"   DATE 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" ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to update a package in Oracle, coming from SQL Server this has
Coming from an Oracle background I cannot believe how SQL Server is giving me
I'm coming from a MS SQL Server background. Working on a new project using
Below is a Class that converts a string (coming from a sql server database)
I am generating Database diagram from Sql server 2005 Professional edition. Clinet is coming
I have renamed a table in a SQL Server 2008 database, from eL_CourseStepUserNotes to
How do you populate data coming from SQL server based on users request? Example:
I need to save measures coming from devices into a SQL database (SQL Server
I am coming from the SQL server world where we had uniqueidentifier. Is there
I'm coming from a SQL Server background. What would the equivalent data types be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.