Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to create sequence value in sybase database?

2 posts in Windows NT Last posting was on 2000-09-05 12:55:28.0Z
Anonymous Posted on 2000-09-05 08:31:52.0Z
From: Anonymous@sybase.com
Date: Tue, 5 Sep 2000 04:31:52 -0400
Newsgroups: sybase.public.sqlserver.nt
Subject: How to create sequence value in sybase database?
Message-ID: <08E1A735D01948A2002EDD0E85256951.002EDD1C85256951@webforums>
Lines: 4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.sqlserver.nt:1676
Article PK: 1089147

Does anyone know how to create sequece value in sybase database just
like 'create sequence ...' in Oracle ?
Thanks.


David Owen Posted on 2000-09-05 12:55:28.0Z
Sender: dowen@kashka.midsomer.org
Subject: Re: How to create sequence value in sybase database?
References: <08E1A735D01948A2002EDD0E85256951.002EDD1C85256951@webforums>
From: David Owen <dowen@midsomer.org>
Organization: Midsomer Consultants Inc.
Date: 05 Sep 2000 06:55:28 -0600
Message-ID: <m2ya17dmm7.fsf@kashka.midsomer.org>
Lines: 28
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Newsgroups: sybase.public.sqlserver.nt
NNTP-Posting-Host: h24-70-23-180.cg.shawcable.net 24.70.23.180
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1674
Article PK: 1089149

>>>>> "Anonymous" == Anonymous <Anonymous@sybase.com> writes:

Sequences, per se, do not exist, what Sybase has are identity columns.
Whilst similar, they are not *exactly* the same. You build a table with
one of the columns defined thus

...
COLNAME NUMERIC(<X>,0) IDENTITY, ...

where <X> is replaced with a number representing the width of the identity
column.

Then, when you insert into the table (you cannot specify a value for
column, so you have to name all of the columns, omitting the identity one),
it is auto-incremented. Does this make sense? I hope you get the
picture. You have to have an insert statment specifying all of the columns
*except* the identity. There, that's better.

HTH

dowen

PS You might want to read the FAQ, identities have a couple of "features"
that you might want to be aware of.

--
David Owen Midsomer Consultants Inc. dowen@midsomer.org
Maintainer of the Sybase FAQ: http://www.isug.com/Sybase_FAQ