methods

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Jan 22 02:46:34 CST 2005


On 1/21/05 7:53 PM, "Olivier" <vidal_olivier at yahoo.fr> wrote:

>> 
>> 
>> 3) what is your task?
>>     give us example of what you need ?
> 
> I have a table of ZIP-Citys :
> 
>    zip=new vstring("zip",5,EVflag.fIndexed)
>    city=new vvarChar("city",100,EVflag.fIndexed+EVflag.findexByWords)
>    CityIdx=new vvarChar("cityIdx",100,EVflag.fIndexed,"city")
> 
> and a table of streets :
> 
>    street=new vvarChar("street",100,EVflag.fIndexed+EVflag.fIndexByWords)
>    streetIdx=new vvarChar("streetIdx",25,EVflag.findexed,"street")
> 
> Every street belongs to a couple zip / city :
> 
> link_Street_ZipCity=new vbinaryLink("link_Street_ZipCity", streetTb,
> ZipCityTb, EVlinkType.kOne, EVlinkType.kMany)

-----
> In a couple zip-city, it cannot have two identical streets there.
> I cannot use of "unique" flag on the column " street " because it can
> have several streets with the same name but in different cities there.
> 
> I thus added in my table "streets", a column " Zip+city+street " which
> contains RecId of the couple zip / city + the name of the street.
> This column has the "unique" flag. OK
> 
> ZipCityStreet=new
> vvarChar("zipCityStreet",110,EVflag.fIndexed+EVflag.fUnique)
> 
> But it takes many place. many. (+ utf16..)
> If I could make a method, in my table streets :
> 
> ZipCityStreet=new
> vvarChar("zipCityStreet",110,EVflag.fIndexed+EVflag.fUnique,"CONCAT(zipC
> ity.RECID,street)")
> 
> I shall have "only" indexes. Many place would be saved.

I think in general case solution is TRIGGER.

We have no triggers, so you can do this manually.

As far as  I see, BEFORE add new street to city,
You need make search of street with such name.

In SQL:

    FROM streets
    WHERE streename = 'aaa' and CityPtr = 1

If search returns zero then you ad this street.


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------




More information about the Valentina-beta mailing list