is there a sequence number generator like oracle?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: is there a sequence number generator like oracle?

Hybrid View

  1. #1
    Kiet Tran Guest

    is there a sequence number generator like oracle?


    Hi,

    I am totally new to Informix. I'd like to know is there a way to generate
    a sequence number (unique number) like oracle in Informix. Your help is
    much appreciate.

    Thanks in advance,
    KT

  2. #2
    Guest

    Re: is there a sequence number generator like oracle?


    "Kiet Tran" <kiet_a_tran@yahoo.com> wrote:
    >
    >Hi,
    >
    >I am totally new to Informix. I'd like to know is there a way to generate
    >a sequence number (unique number) like oracle in Informix. Your help is
    >much appreciate.
    >
    >Thanks in advance,
    >KT


    Hello,
    I think a serial column is what you are searching for. Just define a field
    "unique_number_id" as serial and informix provides every inserted record
    with a unique number. There are some further topics concerning serial fields;
    just look at the documentation.

    Hope I could help you.

    Best wishes.

    Thorsten

  3. #3
    Kalpana Pai Guest

    Re: is there a sequence number generator like oracle?


    "Kiet Tran" <kiet_a_tran@yahoo.com> wrote:
    >
    >Hi,
    >
    >I am totally new to Informix. I'd like to know is there a way to generate
    >a sequence number (unique number) like oracle in Informix. Your help is
    >much appreciate.
    >
    >Thanks in advance,
    >KT


    Hi
    You can create a column with datatype as SERIAL , which will generate a unique
    number.
    Example:
    Create table tab1(no SERIAL not null, name varchar(255));
    Unlike in oracle we have to create a Sequence and attach to table here it
    is simple , just create a column with Serial datatype and make it as PRimary
    key

    Cheers

  4. #4
    Jim Buchalski Guest

    Re: is there a sequence number generator like oracle?


    "Kalpana Pai" <Kalpanapai@hotmail.com> wrote:
    >
    >"Kiet Tran" <kiet_a_tran@yahoo.com> wrote:
    >>
    >>Hi,
    >>
    >>I am totally new to Informix. I'd like to know is there a way to generate
    >>a sequence number (unique number) like oracle in Informix. Your help is
    >>much appreciate.
    >>
    >>Thanks in advance,
    >>KT

    >
    >Hi
    >You can create a column with datatype as SERIAL , which will generate a

    unique
    >number.
    >Example:
    > Create table tab1(no SERIAL not null, name varchar(255));
    >Unlike in oracle we have to create a Sequence and attach to table here it
    >is simple , just create a column with Serial datatype and make it as PRimary
    >key
    >
    >Cheers


    Additionally, IDS 9.4 has sequence objects

    See IBM Informix Guide to SQL: Syntax, Version 9.4, March 2003, Part No.
    CT1SQNA, Chapter 2

    ALTER SEQUENCE
    CREATE SEQUENCE
    DROP SEQUENCE
    RENAME SEQUENCE

    Regards,
    Jim



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center