Re: No duplicates on multiple colums when creating table
Posted in 2000
Richard,
AH, now we have the correct question to answer.....
Look in the syntax at 'primary key'....
a part of the create table statement, after the column definitions:
create table xxx( a ..., b.... , c...., primary key (a,b,c) )....
THAT should fix your problem.
Doug
"Richard Krenek" <rkrenek@ihs.com> wrote in message
news:39411BF7.DFD3206A@ihs.com...
> The answer to the Ingres creating and index is yes as does Informix
(behind
> the scenes as an internal index). I know it is possible to do what I want
in
> the CREATE TABLE statement, it says so in the manual, but it doesn't tell
> you how, it assumes I know what I'm doing. It assumed wrong.
>
> Richard Krenek
>
> Doug Agnew wrote:
>
> > Richard,
> >
> > I think you would have to use an index (and I suspect OpenIngres
probably
> > did so under the covers). Can you imagine searching a million row table
> > SEQUENTIALLY every time you wanted to change a row (or insert a new
one)?
> >
> > Doug
> > "Richard Krenek" <rkrenek@ihs.com> wrote in message
> > news:39410B9F.707267B9@ihs.com...
> > > Hello all,
> > > When doing a CREATE TABLE sql statment how do you declare a record
> > > has to be unique? I know how to say a column has to be distinct but
> > > cannot figure how to set a set of columns to be distinct. I can do it
> > > via an index but I'd prefer to do it while creating the table. Here is
> > > the (OpenIngres) SQL statment I'm trying to reproduce:
> > >
> > > create table doc_bib(
> > > doc_global_id char(16) not null default ' ',
> > > uis_item_time char(16) not null default ' ',
> > > fam_uis_item_time char(16) not null default ' ',
> > > )
> > > with noduplicates;> > >
> > > That "with no duplicates" is throwing me a curve ball!!!
> > >
> > > Richard Krenek
> > >
>