complicated Method construction

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Mar 1 15:06:36 CST 2007


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);


>>> Now I would like to  be cell_levelindicator a method.
>>> This method would need to be:
>>> 
>>> cell_levelindicator = concat(parent_prt->cell_levelindicator ,
>>> "_" ,recid)
>>> 
>>> Is this possible in a method ?
>> 
>> I wonder, why not just to try? :)
> 
> Because I thought it up while writing the mail, and since I'm just
> designing the table there is not yet any data in it :-)
> 
> THis is the way to go then ?

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...
    


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list