🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1487

Re: Auto Increment Question

#1487
From: James Peterson
Date: Thu, 01 Jul 2004 15:35
64 lines
3023 bytes
I believe the (1,1) is your initial value and step value(value increments
you wish to use other then 1 if you desire)



"Kim Utley" <kim@simsware.com> wrote in message
news:40e42ca9@newsgroups.borland.com...
> Sorry it is MS Jet.
>
> When I create a table the statement is:
>
> CREATE TABLE Test( AutoIncrement COUNTER( 1, 1 ) [, other field names and
> types]
>     CONSTRAINT PrimaryKeyIndex PRIMARY KEY( AutoIncrement [, other field
> names and types]  )
>
> This works for all other tables that don't have the autoincrement
> type.However, when I add/use the autoincrement field I get the exception
> "Syntax error in field definition". Any idea what's causing this and what
> does the ( 1, 1 ) in the COUNTER mean?
>
> Kindest Regards,
>
> Kim
>
>
> "Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
> news:40e3b857$1@newsgroups.borland.com...
> > What it your DBMS? In MS SQL Server do:
> > CREATE TABLE Test (Col1 INT IDENTITY(1, 1) PRIMARY KEY)
> >
> > The same syntax works for MS Jet (MS Access), as well as:
> > CREATE TABLE Test (Col1 COUNTER(1, 1) PRIMARY KEY)
> >
> > file://------------------------------------------
> > Regards,
> > Vassiliev V. V.
> > http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
> > ADO.Net
> > http://www.oledbdirect.com - The fastest way to access MS SQL Server,
> > MS Jet (Access) and Interbase (through OLEDB)
> >
> > "Kim Utley" <kim@simsware.com> �������/�������� � �������� ���������:
> > news:40e31878$1@newsgroups.borland.com...
> > > I have the need to use an autoincrement field in a database so the
> primary
> > > key will be unique. However I don't know the SQL syntax for it. I've
> tried
> > > "AUTO_INCREMENT", "AUTOINC" and "AUTO_INC" when creating the table
> fields
> > > but get a failure "Syntax error in field definition". Does anyone have
a
> > > brief example of doing this or the syntax?
> > >
> > > Kindest Regards,
> > >
> > >
> > > Kim Utley
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID: <40e42ec7$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40e31878$1@newsgroups.borland.com> <40e3b857$1@newsgroups.borland.com> <40e42ca9@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,7e1df2a336eac17
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "James Peterson" <jpeterson@romanmealmilling.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <40e31878$1@newsgroups.borland.com> <40e3b857$1@newsgroups.borland.com> <40e42ca9@newsgroups.borland.com>
Subject: Re: Auto Increment Question
Date: Thu, 1 Jul 2004 10:35:20 -0500
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 64.21.236.129
Message-ID: <40e42ec7$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1088696007 64.21.236.129 (1 Jul 2004 08:33:27 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail