complicated Method construction
Bart Pietercil
bart.pietercil at gmail.com
Thu Mar 1 16:01:34 CST 2007
On 1-mrt-07, at 22:06, Ruslan Zasukhin wrote:
> On 1/3/07 10:58 PM, "Bart Pietercil" <bart.pietercil at gmail.com> wrote:
>
> CREATE TABLE "cells" (
> "tree_ptr" OBJECTPTR CONSTRAINT tree_to_cell
> REFERENCES "trees" ON DELETE CASCADE NOT NULL INDEXED,
>
> "parent_ptr" OBJECTPTR CONSTRAINT cellparent_to_cellchild
> REFERENCES "cells" ON DELETE CASCADE NOT NULL INDEXED,
>
> "cell_descr" VARCHAR (1022) NOT NULL INDEXED,
> "cell_name" VARCHAR (255) NOT NULL INDEXED,
> "cell_levelindicator" VARCHAR (2044) NOT NULL INDEXED);
>
>
> Okay I see...
>
> cell_levelindicator =
> concat( parent_prt->cell_levelindicator, "_" ,recid )
>
>
> Hmm, parent_ptr this is pointer to the same table...
> Frankly saying I do not remember if this works.
> Please do simple fast test in Vstudio to see if this design works.
>
>
> -------------
> Aha, I see. You want build string that represent level of item.
>
> * Bart, I think it is not good calculate this each time.
> If item is on 10 level, then VIEW of such record will mean TOUCH of
> 9 its
> parent records. You see?
>
> * Of course it will be indexed, and SEARCHES will not do this
> calculation...
> But simple VIEW will do ..
>
> * OF course you can avoid using VIEW ... If use cursors which not
> SELECT
> this field...
>
So if I don't use it in the SELECT clause, I can use it in the WHERE
and also in ORDER BY .
Correct?
Of course the other way is make it a simple varchar and calculate it
in RB. The disadvantage I think is when one branch is connected to
another and the cell_levelindicator needs to be updated.
So the ideal would maybe be the combination of the two possibilities.
Make it a varchar and have a function doing the update when necessary
(probably regex needed for that) and no functions in 2.5.X is there ?
Probably for now best use varchar and update statements when needed.
I don't think a typical branch will have more than 50 items, so that
should be doable even over internet
Bart
More information about the Valentina
mailing list