Mailing List Archive



Back to the month index Back to the list index

Mike Black (mblack@csihq.com)
Wed, 08 Jan 1997 07:25:22 -0500


Message-Id: <3.0.1.32.19970108072521.009c1c90@mail.csihq.com>
Date: Wed, 08 Jan 1997 07:25:22 -0500
From: Mike Black <mblack@csihq.com>
Subject: Re: [mSQL] ORDER BY + _rowid == bug?

At 06:45 PM 1/7/97 -0800, you wrote:
>How about keeping the original value for _rowid, and have another internal
>column, instead, _tmprowid or something, or conversely, use _oldrowid for
>the original table? This, of course, begs the question, which rowid do you
>use for table joins output? Maintain _table1_rowid, _table2_rowid columns?
>This could get messy.
>

I think all this discussion on _rowid is misleading. Virtually all
databases contain a _rowid type -- but it is limited to the current dataset
you are working with. You can't use it for table joins (and you shouldn't
use _rowd anyway for joins).

_rowid is a dynamic variable. It is NOT fixed per record!! So, let's say
you want to do the following:

CREATE TABLE employee (
        int employee_id,
        name char(50)
)

CREATE TABLE project (
        int project_id,
        name char(50)
)

CREATE TABLE jobassign (
        int employee_id,
        int project_id
)

The ONLY way to set this up is assign a unique value to employee_id and
project_id using something like _seq (not _rowid). This way, you can
export and re-import the table without any problem. Using _rowid to make
the relation would not allow export/import of the tables (_rowid would be
different on another database!).

_rowid should only be used to refer to joined datasets -- in which case it
is most assuredly different from any underlying tables.
-
 /----------------------------------------------------------\
| Mike Black mblack@csihq.com 407-676-2923, x203 |
| Computer Science Innovations, Inc. 407-676-2355 FAX |
| Melbourne FL 32904-2314 http://www.csihq.com |
 \----------------------------------------------------------/
--------------------------------------------------------------------------
To remove yourself from the Mini SQL mailing list send a message containing
"unsubscribe" to "unsubscribe" to msql-list-request@bunyip.com. Send a message containing
"info msql-list" to majordomo@bunyip.com for info on monthly archives of
the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!