Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Posts
    2

    Red face Unanswered: Creating Sequence attached to table column in creation time

    Hi
    In SQL Server / DB2 sequence can be attached to particular column
    of a table

    like SQL Server

    CREATE TABLE [Americas\ServiceGecoDev].[IRIS_IN_EMF_BUYER] (
    [ANKN_ID] [bigint] IDENTITY (1, 1) NOT NULL ,
    [REGION] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [BUYER_ID] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [BUYER_NAME] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [DROPOFF_DATE] [datetime] NOT NULL
    ) ON [PRIMARY]


    My Question


    How do i do the same operation in Oracle 9i/8i.
    I want to get rid of dangling sequence & without help of trigger
    how do i achieve it.
    Can anyone give an example or send a small sql query
    with full incremental situation

  2. #2
    Join Date
    Apr 2003
    Location
    Minneapolis, MN
    Posts
    273
    I don't know SQl Server , So could not understand your code. But In Oracle, You can create a sequence as an object and then you can use it into the table/columns.

    http://www.cs.rpi.edu/~sibel/dbs/FAL...cle/unique.htm

    HTH
    Bhavin

    MS Computer Science
    OCP DBA 9i/8i

  3. #3
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467
    Other may disagree, but without I trigger I do not think you can achieve what you want. Sequences are separate entities and are not tied to a table. You possibly could be real fancy and create a DB trigger on the create table statement that woudl automatically create a trigger on some column, but it does not seem like it would be real useful.
    NOTE: Please disregard the label "Senior Member".

Posting Permissions

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