Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

RealDB Tools & Multiple Primary Keys (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: stuck on instr stuff
Next thread: Sound-in Live!


Quicktime tracks / layers   -   Derek Seabrooke - CSCI/P2001
  RealDB Tools & Multiple Primary Keys   -   Steve Schacht
   Re: RealDB Tools & Multiple Primary Keys   -   Seth Willits
    Re: RealDB Tools & Multiple Primary Keys   -   Steve Schacht
     Re: RealDB Tools & Multiple Primary Keys   -   Norman Palardy
      Re: RealDB Tools & Multiple Primary Keys   -   Steve Schacht
       Re: RealDB Tools & Multiple Primary Keys   -   Norman Palardy
       Re: Indexing RealDB Fields (was RealDB Tools & Multiple Primary Keys)   -   Steve Schacht
   Re: RealDB Tools & Multiple Primary Keys   -   Chris Little
   Re: RealDB Tools & Multiple Primary Keys   -   Norman Palardy
    Re: RealDB Tools & Multiple Primary Keys   -   Steve Schacht
     Re: RealDB Tools & Multiple Primary Keys   -   Norman Palardy
     Re: RealDB Tools & Multiple Primary Keys   -   Chris Little
      Re: RealDB Tools & Multiple Primary Keys   -   Steve Schacht
       Re: RealDB Tools & Multiple Primary Keys   -   Joseph J. Strout
        Re: RealDB Tools & Multiple Primary Keys   -   Steve Schacht
       Re: RealDB Tools & Multiple Primary Keys   -   James Sentman
        Re: RealDB Tools & Multiple Primary Keys   -   Steve Schacht
        Re: RealDB Tools & Multiple Primary Keys   -   john roberts
       Re: RealDB Tools & Multiple Primary Keys   -   Roland Voegtli
     Re: RealDB Tools & Multiple Primary Keys   -   Charles Yeomans
   Re: RealDB Tools & Multiple Primary Keys   -   James Lucas
    Re: RealDB Tools & Multiple Primary Keys   -   Steve Schacht
    Re: RealDB Tools & Multiple Primary Keys   -   Joseph J. Strout
     Re: RealDB Tools & Multiple Primary Keys   -   Steve Schacht
    Re: RealDB Tools & Multiple Primary Keys   -   Norman Palardy
   Re: RealDB Tools & Multiple Primary Keys   -   James Lucas

RealDB Tools & Multiple Primary Keys
Date: 02.08.02 01:48 (Thu, 01 Aug 2002 18:48:56 -0600)
From: Steve Schacht
RealDB Tools doesn't seem to allow you to specify more than one field in a
table as a Primary Key. Actually, it does let you specify more than one
while editing the schema, but it only actually saves one of the fields as
Primary. Is there any particular reason, or is it a bug in RealDB Tools?

---
Steve Schacht
<email address removed>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 02:36 (Thu, 01 Aug 2002 18:36:54 -0700)
From: Seth Willits
On 8/1/02 5:48 PM, the NSA intercepted the following message from "Steve
Schacht" <<email address removed>>:

> RealDB Tools doesn't seem to allow you to specify more than one field in a
> table as a Primary Key. Actually, it does let you specify more than one
> while editing the schema, but it only actually saves one of the fields as
> Primary. Is there any particular reason, or is it a bug in RealDB Tools?

There should only be one primary key, so it must be a bug in the program.

Seth Willits
---------------------------------------------------------------------------
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com

"Great spirits have always encountered violent opposition from mediocre
minds."
-- Albert Einstein
---------------------------------------------------------------------------


---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 04:03 (Thu, 01 Aug 2002 21:03:48 -0600)
From: Steve Schacht
On 8-1-2002 7:36 PM, Seth Willits wrote:

> On 8/1/02 5:48 PM, the NSA intercepted the following message from "Steve
> Schacht" <<email address removed>>:
>
>> RealDB Tools doesn't seem to allow you to specify more than one field in a
>> table as a Primary Key. Actually, it does let you specify more than one
>> while editing the schema, but it only actually saves one of the fields as
>> Primary. Is there any particular reason, or is it a bug in RealDB Tools?
>
> There should only be one primary key, so it must be a bug in the program.

And then on 8-1-2002 7:37 PM, Chris Little wrote:

> You're only allowed one primary key so it's a bug in RealDB Tools.

Well, IF you are allowed only one primary key, then the RB IDE schema editor
is _really_ buggy because it let's you create a RealDB with multiple primary
keys with NO problem.

However, I'm not convinced that allowing mulitple primary keys is a bug. I
think the bug is that RealDB tools won't save the multiple primary keys it
lets you specify.

Can anyone tell me why one shouldn't be able to have more than one primary
key? Other DB's allow it, do they not?

---
Steve Schacht
<email address removed>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 04:50 (Thu, 1 Aug 2002 21:50:22 -0600)
From: Norman Palardy
No, they do not

In fact in a properly normalized database every table has one and only
one primary key
Few people ever take their normalization efforts this far, but that
would be strictly proper

However, many databases permit you to define numerous indexes which in
many cases roughly equate to keys

Since this is SQL any field can be queried anyways so what you are
really looking for is indexes and not strictly keys as you might if this
were an older ISAM file

On Thursday, August 1, 2002, at 09:03 PM, Steve Schacht wrote:

> On 8-1-2002 7:36 PM, Seth Willits wrote:
>
>> On 8/1/02 5:48 PM, the NSA intercepted the following message from
>> "Steve
>> Schacht" <<email address removed>>:
>>
>>> RealDB Tools doesn't seem to allow you to specify more than one field
>>> in a
>>> table as a Primary Key. Actually, it does let you specify more than
>>> one
>>> while editing the schema, but it only actually saves one of the
>>> fields as
>>> Primary. Is there any particular reason, or is it a bug in RealDB
>>> Tools?
>>
>> There should only be one primary key, so it must be a bug in the
>> program.
>
> And then on 8-1-2002 7:37 PM, Chris Little wrote:
>
>> You're only allowed one primary key so it's a bug in RealDB Tools.
>
> Well, IF you are allowed only one primary key, then the RB IDE schema
> editor
> is _really_ buggy because it let's you create a RealDB with multiple
> primary
> keys with NO problem.
>
> However, I'm not convinced that allowing mulitple primary keys is a
> bug. I
> think the bug is that RealDB tools won't save the multiple primary keys
> it
> lets you specify.
>
> Can anyone tell me why one shouldn't be able to have more than one
> primary
> key? Other DB's allow it, do they not?
>
> ---
> Steve Schacht
> <email address removed>
> ---
> Subscribe to the digest:
> <mailto:<email address removed>>
> Unsubscribe:
> <mailto:<email address removed>>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 05:11 (Thu, 01 Aug 2002 22:11:28 -0600)
From: Steve Schacht
On 8-1-2002 9:50 PM, Norman Palardy wrote:

> However, many databases permit you to define numerous indexes which in
> many cases roughly equate to keys

Yes, that is what I'm thinking of.

> Since this is SQL any field can be queried anyways so what you are
> really looking for is indexes and not strictly keys as you might if this
> were an older ISAM file

So then how exactly does an index differ from a key? Or is the whole notion
of "keys" outdated or what?

Thanks much,

---
Steve Schacht
<email address removed>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 07:08 (Fri, 2 Aug 2002 00:08:33 -0600)
From: Norman Palardy

On Thursday, August 1, 2002, at 10:11 PM, Steve Schacht wrote:

> On 8-1-2002 9:50 PM, Norman Palardy wrote:
>
>> However, many databases permit you to define numerous indexes which in
>> many cases roughly equate to keys
>
> Yes, that is what I'm thinking of.

Fair enough. Keys for a row are not necessarily always what you index on

>> Since this is SQL any field can be queried anyways so what you are
>> really looking for is indexes and not strictly keys as you might if
>> this
>> were an older ISAM file
>
> So then how exactly does an index differ from a key? Or is the whole
> notion
> of "keys" outdated or what?

It's not outdated, just sometimes misapplied

For instance, in order to make Sybase physically spread data inserts
around you sometimes deliberately create an index that will insure your
data inserts are not always "at the same end" of your data.

In one application I worked on the data was coming in fast (5000 rows
per minute) Inserting the data in natural order (date and time) meant
that all data got added to the end of the index. However, if we indexed
by location instead the inserts we spread about. If the natural key for
this real time data is DATE and TIME (which are strictly increasing)
then all your inserts would be at the end of this table (and therefore
likely in similar spots on the disk and in the indexes)

However, you can deliberately not index the data this way to get the
inserts all over

In this case the KEY is still DATE and TIME, but the index is based on
other columns

In lots of cases though the key and the index are one and the same, so
it's not surprising they get used interchangeably

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 02:37 (Thu, 01 Aug 2002 21:37:24 -0400)
From: Chris Little
on 8/1/02 8:48 PM, Steve Schacht at <email address removed> wrote:

> RealDB Tools doesn't seem to allow you to specify more than one field in a
> table as a Primary Key. Actually, it does let you specify more than one
> while editing the schema, but it only actually saves one of the fields as
> Primary. Is there any particular reason, or is it a bug in RealDB Tools?
>

You're only allowed one primary key so it's a bug in RealDB Tools.

Chris

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 04:46 (Thu, 1 Aug 2002 21:46:54 -0600)
From: Norman Palardy
Do you mean compound primary keys ? This would be nice

Or actually setting several columns to be primary ? This, in practice,
is not usually permitted or desriable

On Thursday, August 1, 2002, at 06:48 PM, Steve Schacht wrote:

> RealDB Tools doesn't seem to allow you to specify more than one field
> in a
> table as a Primary Key. Actually, it does let you specify more than one
> while editing the schema, but it only actually saves one of the fields
> as
> Primary. Is there any particular reason, or is it a bug in RealDB
> Tools?
>
> ---
> Steve Schacht
> <email address removed>
> ---
> Subscribe to the digest:
> <mailto:<email address removed>>
> Unsubscribe:
> <mailto:<email address removed>>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 05:08 (Thu, 01 Aug 2002 22:08:50 -0600)
From: Steve Schacht
Thanks for the reply, Norman.

On 8-1-2002 9:46 PM, Norman Palardy wrote:

> Or actually setting several columns to be primary ?

Yes.

> This, in practice,
> is not usually permitted or desriable

Well RB permits it. I'm curious as to why it's not desirable. I was under
the impression that a primary key was basically just an indexed column.
Apparently there's more to it than that. Perhaps in RB they are one and the
same, as there appears to be no way to "index" a column. What if I want to
optimize searches on more than one column of the table? How do I go about
that if I can't index more than one?

---
Steve Schacht
<email address removed>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 07:00 (Fri, 2 Aug 2002 00:00:30 -0600)
From: Norman Palardy
RB may allow it but is using slightly sloppy terminology
An indexed column is not necessarily always a key column.

If you want to optimize searches on more than one column then you might
index several columns in different ways depending on how the particular
database engine optimizes queries

For instance, Sybase tends to cache indexes in RAM and, if your query
only requires data that is in the index, it will never go back to the
disk and reread the data as it already has it in RAM
Other schemes to index things in Sybase and Oracle can be used to avoid
contention, but not necessarily to speed up queries

On Thursday, August 1, 2002, at 10:08 PM, Steve Schacht wrote:

> Thanks for the reply, Norman.
>
> On 8-1-2002 9:46 PM, Norman Palardy wrote:
>
>> Or actually setting several columns to be primary ?
>
> Yes.
>
>> This, in practice,
>> is not usually permitted or desriable
>
> Well RB permits it. I'm curious as to why it's not desirable. I was
> under
> the impression that a primary key was basically just an indexed column.
> Apparently there's more to it than that. Perhaps in RB they are one
> and the
> same, as there appears to be no way to "index" a column. What if I
> want to
> optimize searches on more than one column of the table? How do I go
> about
> that if I can't index more than one?

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 13:05 (Fri, 02 Aug 2002 08:05:27 -0400)
From: Chris Little
on 8/2/02 12:08 AM, Steve Schacht at <email address removed> wrote:

> Thanks for the reply, Norman.
>
> On 8-1-2002 9:46 PM, Norman Palardy wrote:
>
>> Or actually setting several columns to be primary ?
>
> Yes.
>
>> This, in practice,
>> is not usually permitted or desriable
>
> Well RB permits it. I'm curious as to why it's not desirable. I was under
> the impression that a primary key was basically just an indexed column.
> Apparently there's more to it than that. Perhaps in RB they are one and the
> same, as there appears to be no way to "index" a column. What if I want to
> optimize searches on more than one column of the table? How do I go about
> that if I can't index more than one?

You don't. RB DB is quite limited. You can have one primary key per table
and only that column is indexed.

Chris

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 16:14 (Fri, 02 Aug 2002 09:14:31 -0600)
From: Steve Schacht
On 8-2-2002 6:05 AM, Chris Little wrote:

> You don't. RB DB is quite limited. You can have one primary key per table
> and only that column is indexed.

No, in fact, you _can_ have more than one primary key per table in RB. At
this point, I just need to know if it's a bug in RB or by design. I haven't
heard from anyone at RS yet.

Thanks though,

---
Steve Schacht
<email address removed>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 16:58 (Fri, 2 Aug 2002 08:58:24 -0700)
From: Joseph J. Strout
At 9:14 AM -0600 8/2/02, Steve Schacht wrote:

> > You don't. RB DB is quite limited. You can have one primary key per table
>> and only that column is indexed.
>
>No, in fact, you _can_ have more than one primary key per table in RB. At
>this point, I just need to know if it's a bug in RB or by design. I haven't
>heard from anyone at RS yet.

OK, I'll bite: you can't have more than one primary key per table.
You can have only one primary key, and only that column is indexed
(exactly as Chris said).

If you have seen something that indicates you can create more than
one primary key, please report it with REALbugs.

Thanks,
- Joe

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 17:23 (Fri, 02 Aug 2002 10:23:31 -0600)
From: Steve Schacht
On 8-2-2002 9:58 AM, Joseph J. Strout wrote:

> At 9:14 AM -0600 8/2/02, Steve Schacht wrote:
>
>>> You don't. RB DB is quite limited. You can have one primary key per table
>>> and only that column is indexed.
>>
>> No, in fact, you _can_ have more than one primary key per table in RB. At
>> this point, I just need to know if it's a bug in RB or by design. I haven't
>> heard from anyone at RS yet.
>
> OK, I'll bite: you can't have more than one primary key per table.

That's not what's indicated in the schema editor of _both_ the IDE and
RealDB Tools.

> You can have only one primary key, and only that column is indexed
> (exactly as Chris said).

Well, that might be what's _supposed_ to happen, but it's not what happens.

> If you have seen something that indicates you can create more than
> one primary key, please report it with REALbugs.

A bug report is on the way. It's ultra-simple to do. Just add a new RealDB
data source to a project, and specify more than one field as primary key
using the schema editor. Simple as that. The multiple primary keys appear
to be saved to the DB, because you can start a new project, add the DB you
created, and there are the multiple keys. You can also open that DB with
RealDB Tools, and even _it_ indicates that there are multiple primary key.
However, RealDB Tools will only save the file with one primary key, whereas,
the IDE schema editor saves multiple. I'm surprised that no one has
discovered this until now. Anyway, that's all I wanted to know - whether
this behavior is intended or not.

Thanks,

---
Steve Schacht
<email address removed>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 17:07 (Fri, 2 Aug 2002 12:07:38 -0400)
From: James Sentman
>At 9:14 AM -0600 8/2/02, Steve Schacht wrote:
>
>> > You don't. RB DB is quite limited. You can have one primary
>>key per table
>>> and only that column is indexed.
>>
>>No, in fact, you _can_ have more than one primary key per table in RB. At
>>this point, I just need to know if it's a bug in RB or by design. I haven't
>>heard from anyone at RS yet.
>
>OK, I'll bite: you can't have more than one primary key per table.
>You can have only one primary key, and only that column is indexed
>(exactly as Chris said).
>

I can't say as having more primary keys makes any sense to me, but I
would be able to speed up several projects if I could create separate
indexes on other fields. Is this in the cards for the realbd anytime
soon? Should I realbug it again? Does anyone else think that creating
multiple indexes would be a good thing? That would seem to be what
people are describing by wanting multiple primary keys.

Make your realbugs reports now, but dont ask for multiple primary
keys, ask for secondary indexes!

-James

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 17:27 (Fri, 02 Aug 2002 10:27:02 -0600)
From: Steve Schacht
On 8-2-2002 10:07 AM, James Sentman wrote:

> I can't say as having more primary keys makes any sense to me,

Me neither, now that I understand the distinction between primary keys and
regular indexes.

> Does anyone else think that creating
> multiple indexes would be a good thing?

Absolutely.

> Make your realbugs reports now, but dont ask for multiple primary
> keys, ask for secondary indexes!

Of course.

Regards,

---
Steve Schacht
<email address removed>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 18:04 (Fri, 02 Aug 2002 13:04:54 -0400)
From: john roberts
on 8/2/02 12:07 PM, James Sentman at <email address removed> wrote:

> I can't say as having more primary keys makes any sense to me, but I
> would be able to speed up several projects if I could create separate
> indexes on other fields. Is this in the cards for the realbd anytime
> soon? Should I realbug it again? Does anyone else think that creating
> multiple indexes would be a good thing? That would seem to be what
> people are describing by wanting multiple primary keys.
>
Multiple indices are not "good" ... they are essential !

John

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 18:50 (Fri, 2 Aug 2002 19:50:10 +0200)
From: Roland Voegtli
>I can't say as having more primary keys makes any sense to me, but I
>would be able to speed up several projects if I could create
>separate indexes on other fields.

Me too. Definitely.

>Does anyone else think that creating multiple indexes would be a good thing?

Oh yes. I would appreciate that very much indeed. maybe even combined
indexes on multiple fields?

Regards
Roland



---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 02.08.02 15:25 (Fri, 2 Aug 2002 10:25:45 -0400)
From: Charles Yeomans

On Friday, August 2, 2002, at 12:08 AM, Steve Schacht wrote:

> Thanks for the reply, Norman.
>
> On 8-1-2002 9:46 PM, Norman Palardy wrote:
>
>> Or actually setting several columns to be primary ?
>
> Yes.
>
>> This, in practice,
>> is not usually permitted or desriable
>
> Well RB permits it. I'm curious as to why it's not desirable. I was
> under
> the impression that a primary key was basically just an indexed column.
> Apparently there's more to it than that. Perhaps in RB they are one
> and the
> same, as there appears to be no way to "index" a column. What if I
> want to
> optimize searches on more than one column of the table? How do I go
> about
> that if I can't index more than one?

The simplest way would be to use Valentina.

Charles Yeomans


---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 03.08.02 00:53 (Sat, 3 Aug 2002 09:53:54 +1000)
From: James Lucas
Joe you say this is a bug but since version 2 (when I started using it)
I have been able to create RB databases with multiple primary keys.

Despite people been against having two primary keys it is useful when
creating link tables where only have two columns to link data and both
are primary (and other uses)

Also SQL allows multiple primary keys to be created

create Table <table_name>(key1 integer, key2 integer, Primary key (Key1,
Key2)) (all valid SQL)

So why are you saying this is a bug? The database allows it and so does
SQL

Cheers,
James Lucas

On Saturday, August 3, 2002, at 02:04 AM, REALbasic Network Users Group
wrote:

> Subject: Re: RealDB Tools & Multiple Primary Keys
> From: "Joseph J. Strout" <<email address removed>>
> Date: Fri, 2 Aug 2002 08:58:24 -0700
>
> At 9:14 AM -0600 8/2/02, Steve Schacht wrote:
>
>>> You don't. RB DB is quite limited. You can have one primary key per
>>> table
>>> and only that column is indexed.
>>
>> No, in fact, you _can_ have more than one primary key per table in
>> RB. At
>> this point, I just need to know if it's a bug in RB or by design. I
>> haven't
>> heard from anyone at RS yet.
>
> OK, I'll bite: you can't have more than one primary key per table.
> You can have only one primary key, and only that column is indexed
> (exactly as Chris said).
>
> If you have seen something that indicates you can create more than
> one primary key, please report it with REALbugs.
>
> Thanks,
> - Joe
>
> --
> ,------------------------------------------------------------------.
> | Joseph J. Strout REAL Software, Inc. |
> | <email address removed> http://www.realsoftware.com |
> `------------------------------------------------------------------'
>

I feel sorry for people who don't drink. When they wake up in the
morning, that's as good as they're going to feel all day.
- Frank Sinatra
-------------------------------------------------------------------

James Lucas
0411 098 701
<email address removed>
http://www.secsme.org.au

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 03.08.02 01:01 (Fri, 02 Aug 2002 18:01:06 -0600)
From: Steve Schacht
On 8-2-2002 5:53 PM, James Lucas wrote:

> Joe you say this is a bug but since version 2 (when I started using it)
> I have been able to create RB databases with multiple primary keys.

Interesting.

> Despite people been against having two primary keys it is useful when
> creating link tables where only have two columns to link data and both
> are primary (and other uses)
>
> Also SQL allows multiple primary keys to be created
>
> create Table <table_name>(key1 integer, key2 integer, Primary key (Key1,
> Key2)) (all valid SQL)

Yeah, I thought I had encountered that when I was monkeying around with
MySQL and some schema editors a few months ago. That's partly why I posed
the question.

Regards,

---
Steve Schacht
<email address removed>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 03.08.02 04:18 (Fri, 2 Aug 2002 20:18:38 -0700)
From: Joseph J. Strout
At 9:53 AM +1000 8/3/02, James Lucas wrote:

>Joe you say this is a bug but since version 2 (when I started using
>it) I have been able to create RB databases with multiple primary
>keys.

Yes, clearly something strange is going on there.

>Also SQL allows multiple primary keys to be created
>
>create Table <table_name>(key1 integer, key2 integer, Primary key
>(Key1, Key2)) (all valid SQL)

No, that creates a single primary key composed of two fields (i.e., a
compound key). It is invalid to have more than one primary key in
SQL.

Cheers,
- Joe

Re: RealDB Tools & Multiple Primary Keys
Date: 03.08.02 04:54 (Fri, 02 Aug 2002 21:54:30 -0600)
From: Steve Schacht
On 8-2-2002 9:18 PM, Joseph J. Strout wrote:

> At 9:53 AM +1000 8/3/02, James Lucas wrote:

>> create Table <table_name>(key1 integer, key2 integer, Primary key
>> (Key1, Key2)) (all valid SQL)
>
> No, that creates a single primary key composed of two fields (i.e., a
> compound key).

Ohhhhhh, I get it.

---
Steve Schacht
<email address removed>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 03.08.02 04:25 (Fri, 2 Aug 2002 21:25:59 -0600)
From: Norman Palardy
In that case neither is a primary, they are both foreign keys, but
having them indexed is useful

On Friday, August 2, 2002, at 05:53 PM, James Lucas wrote:

> Joe you say this is a bug but since version 2 (when I started using it)
> I have been able to create RB databases with multiple primary keys.
>
> Despite people been against having two primary keys it is useful when
> creating link tables where only have two columns to link data and both
> are primary (and other uses)
>
> Also SQL allows multiple primary keys to be created
>
> create Table <table_name>(key1 integer, key2 integer, Primary key
> (Key1, Key2)) (all valid SQL)
>
> So why are you saying this is a bug? The database allows it and so does
> SQL
>
> Cheers,
> James Lucas
>
> On Saturday, August 3, 2002, at 02:04 AM, REALbasic Network Users
> Group wrote:
>
>> Subject: Re: RealDB Tools & Multiple Primary Keys
>> From: "Joseph J. Strout" <<email address removed>>
>> Date: Fri, 2 Aug 2002 08:58:24 -0700
>>
>> At 9:14 AM -0600 8/2/02, Steve Schacht wrote:
>>
>>>> You don't. RB DB is quite limited. You can have one primary key
>>>> per table
>>>> and only that column is indexed.
>>>
>>> No, in fact, you _can_ have more than one primary key per table in
>>> RB. At
>>> this point, I just need to know if it's a bug in RB or by design. I
>>> haven't
>>> heard from anyone at RS yet.
>>
>> OK, I'll bite: you can't have more than one primary key per table.
>> You can have only one primary key, and only that column is indexed
>> (exactly as Chris said).
>>
>> If you have seen something that indicates you can create more than
>> one primary key, please report it with REALbugs.
>>
>> Thanks,
>> - Joe
>>
>> --
>> ,------------------------------------------------------------------.
>> | Joseph J. Strout REAL Software, Inc. |
>> | <email address removed> http://www.realsoftware.com |
>> `------------------------------------------------------------------'
>>
> I feel sorry for people who don't drink. When they wake up in the
> morning, that's as good as they're going to feel all day.
> - Frank Sinatra
> -------------------------------------------------------------------
>
> James Lucas
> 0411 098 701
> <email address removed>
> http://www.secsme.org.au
>
> ---
> Subscribe to the digest: <mailto:realbasic-nug-
> <email address removed>>
> Unsubscribe:
> <mailto:<email address removed>>

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>

Re: RealDB Tools & Multiple Primary Keys
Date: 04.08.02 02:52 (Sun, 4 Aug 2002 11:52:24 +1000)
From: James Lucas
>> Also SQL allows multiple primary keys to be created
>>
>> create Table <table_name>(key1 integer, key2 integer, Primary key
>> (Key1, Key2)) (all valid SQL)
>
> No, that creates a single primary key composed of two fields (i.e., a
> compound key). It is invalid to have more than one primary key in
> SQL.

Yes, well this is what I think he was talking about in the first place,
he wanted a primary key comprising of multiple columns (Correct me if I
misunderstood)

Cheers,
James Lucas

It is impossible to get anywhere without sinning against reason.
- Albert Einstein
-------------------------------------------------------------------

James Lucas
0411 098 701
<email address removed>
http://www.secsme.org.au

---
Subscribe to the digest:
<mailto:<email address removed>>
Unsubscribe:
<mailto:<email address removed>>