Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Field Order via Oracle ODBC
If you look at the needs of the data structure, rather than an example of
the output required for a single invoice, you'll see that only the Foreign
Key from the many side, participates in the join. If you only include a
single field of a multiple field index, you cannot optimize the query.
The order you required can be maintained either with an autonumber PK or
with an indexed linenumber, however the database will enforce the autonumber
PK index at the table level without any additional code. The linenumber may
be required for display, but not for storage. In an invoice (report) it can
be computed and sorted using a running sum.
---
Arvin Meyer
onsite_at_esinet.net
Vincent Quesnoit wrote in message
<375F62F7.E7EBB45D_at_bull.net.Earth.Solar_System.milky_way>...
>
>I found some instances when that kind of field (invoicelinenumber) is
required
>as a complement to the detail primary key, that is when you need to record
some
>order amongst detail records. I have a non-substantiated feeling that the
>autonumber primary key may not be the right field to do that.
>Once you do need that second level key, the Detail primary key looks
redundant.
>
>This design problem occured recently when I tried to break expressions such
as :
>(a or b) and((b or c) and z) into a sequence of records to get a tabular
>representation. There you obviously need a key to designate an expression,
and a
>key to order the elements within the expression.
>The big concern is : how do I let people change the content of an
expression,
>and keep it in order. For me the answer was a LineNumber field.
>In that context the Autonumber key is redundant.
>
>Vincent Quesnoit
Received on Thu Jun 10 1999 - 09:35:40 CDT
![]() |
![]() |