Enable Question
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: Enable Question

Hybrid View

  1. #1
    Join Date
    Sep 2000
    Posts
    23

    Red face

    I gest saw in a STS that Enable clause can be used in a Create Table command.


    Can somebody post a piece of code with this?

    Thank you,
    Marian

    [Edited by dmarian on 09-28-2000 at 01:02 PM]

  2. #2
    Join Date
    Jul 2000
    Location
    Amsterdam
    Posts
    234

    Enable question

    Hello dmarian,

    According to the DBA handbook it must be something like:

    CREATE TABLE EMPLOYEES
    (
    EMPID NUMBER(10),
    LASTNAME VARCHAR2(25) NOT NULL,
    FIRSTNAME VARCHAR2(25) NOT NULL,
    CONSTRAINT PK_EMPLOYEES_01
    PRIMARY KEY (EMPID),
    DISABLE CONSTRAINT PK_EMPLOYEES_01
    );

    But this does not work on my 8.0.5 database?

    Have to try it on a 8.1.5 @ home.
    (Using partitioning there is also a posibility of enabling/disabling row movement)

    tycho

  3. #3
    Join Date
    Sep 2000
    Posts
    23
    Thanks Tycho

    What I'm not sure to undertand, when we create a table
    with constraints, why we need to enable theses constraints,
    on witch case would we doing this, the constrants are enable by default at creation, to create a table with disabled constraints it's okay, there may be a reason to doing this.
    Anyways, I pass my exam and there was no question about
    this.

  4. #4
    Join Date
    Jul 2000
    Location
    Amsterdam
    Posts
    234

    Enable question

    Hi dmarian,

    Congrets with the passing of PL/SQL SQL exam.

    For some reason unknown to me there is some redundancy in Oracle SQL.
    You will notice this when studying for other exams.

    The create table command also didn't work @ home. So there must be something wrong with the code.
    Probably better to use both create table and alter table commands for this purpose.

    tycho


  5. #5
    Join Date
    Nov 1999
    Location
    Elbert, Colorado, USA
    Posts
    81
    The code doesn't work because it's wrong. Try this:

    CREATE TABLE EMPLOYEES
    (
    EMPID NUMBER(10),
    LASTNAME VARCHAR2(25) NOT NULL,
    FIRSTNAME VARCHAR2(25) NOT NULL,
    CONSTRAINT PK_EMPLOYEES_01
    PRIMARY KEY (EMPID) DISABLE
    );

    If the Handbook you are referring to is the one from Oracle Press, be advised that it is notoriously flawed.

  6. #6
    Join Date
    Jul 2000
    Location
    Amsterdam
    Posts
    234

    Enable question

    Thanx carp

    I looked it up in an other book and there they used the syntax you just described.

    The wrong code came from Loney & Theriault from Oracle press probably this is the book you are talking about.

    Better not trust this book and use it only for leveling my monitor then.

    tycho

  7. #7
    Join Date
    Nov 1999
    Location
    Elbert, Colorado, USA
    Posts
    81
    It's also large enough to keep a door open.
    While there is a lot of good information in this book, there is also a lot of bad information! Consequently, you must already know the information to sort out the good from the bad!!

    I think it best to stick with the Server Concepts Manual.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width