[comp.databases] Ingres QUEL/EQUEL Replace Question

wdelv@devnet3.hac.com (walt del vecchio) (08/02/89)

I am attempting to perform a replace using Ingres QUEL/EQUEL.
The following example explains the rules of the replace:

range of t is temp
retrieve ( a_no = int2 ( t.assoc_no ),
        bag = int2 ( t.bag_no ),
        seq_no = int4 ( t.cond_seq_no ),
        bigbag = min ( int2 ( t.sup_bag_no )
                by t.bag_no ),
        w_no = min ( int2 ( t.w_no )
                by t.sup_bag_no ) )


|a_no  |bag   |seq_no       |bigbag|w_no  |
|-----------------------------------------|
|     1|    10|         1124|      |     2|
|     1|    65|         1134|      |     2|
|     2|    10|         1129|      |     2|
|     2|    65|         1131|      |     2|
|     3|    10|         1147|      |    75|
|     3|    47|         1148|      |    75|
|     4|    10|         1155|      |    75|
|     4|    47|         1156|      |    75|
|     5|    11|           94|      |     2|
|     5|    65|         1133|      |     2|
|     6|    11|          530|      |     9|
|     6|    31|         1166|      |     9|
|     7|    19|           75|      |     1|
|     7|    26|           66|      |     1|
|-----------------------------------------|

What this table represents is a set of wires
which are to be connected to each other.

a_no is an arbitrary association number assigned to two wires which are to be
attached to the same pin.

bag is a grouping of similar wires to be cut
(in order to minimize cutting setup time).

seq_no is just an arbitrary number assigned to each conductor.

bigbag is an arbitrary number used to associate the group of all wires
which need to be brought together by bags for subsequent attachment to pins.

w_no is an arbitrary number used to associate the group of wires which will
become attached to each other.

The goal here is to replace the bigbag value with an arbitrary value which
could be used to associate all bags which need to be brought together for
subsequent attachement of pins.

Physically what is happening here is that wires from one bag may be used to
construct different series of attached wires of which may be composed of wires
from other bags, and that the attachment procedure should begin by gathering
all bags labeled with the same bigbag number.

In the example above the first six pairs of wires are related since
bags 10, 11, 31, 47, and 65 all use wires to build groups (w_no) 2, 9, and 75.
Wires from bag 10 are needed with wires from bags 65 and 47,
and also wires from bag 65 are needed with wires from bag 11,
and also wires from bag 11 are needed with wires from bag 31.
These should reference the same arbitrary bigbag number ( maybe the min w_no ).
The last two wires get attached to each other but are not related to wires
in any other bags.
So these would be assigned another bigbag number unique from the first one.

I would appreaciate help in constructing an Ingres QUEL/EQUEL replace statement
to make the bigbag assignments ( is it possible ? ).
Otherwise, I'll just do it in C.


Walt Del Vecchio  -  Hughes Aircraft Co.   P.O. Box 6724   Fullerton, Ca. 92631
                     (714) 732 - 5588      wdelv%devnet3@hac2arpa.hac.com