DBASupport

 The Knowledge Center for Oracle Professionals
HOME 11g Central 10g Central 9i Central 8i Central Oracle News Scripts FAQ OCP Zone Resources Technical Docs Tools & Utilities Forums

» HOME
» FEATURES
    11g Central
    10g Central
    9i Central
    8i Central
    Oracle News
» COMMUNITY
    Scripts
    Forums
    FAQ
    OCP Zone
» RESOURCES
    Resources
    Technical Docs
    Tools & Utilities
    Tech Jobs
Marketplace Partners
Become a Marketplace Partner






Internet News
Small Business

Advertise
Newsletters
Tech Jobs
E-mail Offers


   DBAsupport.com > Oracle > Oracle 9i Central > Listen Software Solutions' "How To" Series



 

Oracle Developer Jr - READY TO HIRE!
Next Step Systems
US-CA-Thousand Oaks

Justtechjobs.com Post A Job | Post A Resume

Listen Software Solutions' "How To" Series:

Tables

By David Nishimoto


Creating a Table

CREATE TABLE {table_name}
(
    {field1} VARCHAR2(10),
    {field2} NUMBER(10)
)
PCTFREE 30
PCTUSED 60
TABLESPACE (tablespace_name)
STORAGE
(
    INITIAL integer
    NEXT integer
);

Adding a Primary Constraint

ALTER TABLE {A_TABLE} ADD (
    CONSTRAINT {A_TABLE_PK}
    PRIMARY KEY ({A_TABLE_IDX})
    USING INDEX
    TABLESPACE {MY_TABLESPACE}
    PCTFREE 10
    STORAGE
    (
    INITIAL 20K
    NEXT 40K
    )
)

Adding a Foreign Key Constraint

ALTER TABLE (table_name) ADD
    (
    CONSTRAINT (foreign key constraint name)
    FOREIGN KEY
    (field name )
    REFERENCES primary_table_name
    (
    primary_table_primary_index_field
    )


* The foreign key references a unique key in the primary table. The relation is a one-to-many relationship.

Rebuilding Indexes

alter index {my_index_idx} rebuild;

* Does not drop the constraints


Back to the LSS "How To" Series Main Page





[an error occurred while processing this directive]