[V4MD] unique between two fields

Ivan Smahin IvanSmahin at public.kherson.ua
Sat Nov 5 16:36:16 CST 2005


Hello info,

Saturday, November 5, 2005, 4:18:57 PM, you wrote:


ivc> ----- Original Message -----
ivc> From: "Ivan Smahin" <IvanSmahin at public.kherson.ua>
ivc> To: "Valentina Beta" <valentina-beta at lists.macserve.net>
ivc> Sent: Saturday, November 05, 2005 2:51 PM
ivc> Subject: Re[4]: [V4MD] unique between two fields


>> Hello info,
>>
>> Saturday, November 5, 2005, 3:36:13 PM, you wrote:
>>
>> ivc> Hi Ivan,
>>
>> ivc> I've not better understand, sorry
>> ivc> my code for create table and fields is a bit different:
>>
>> ivc> eg
>> ivc> Discipline = gDb.createTable("Discipline ")
>> ivc> Discipline .createStringField("Discipline_Name",  36)
>> ivc> Discipline .createStringField("Discipline_Year",  9)  -- (eg
ivc> 2005-2006)
>>
>> ivc> I've tried to modify this with your useful help but I get error...
>>
>> The main idea is:
>> You need the method which is unique and combine both fields.
>>
>> So you need something like
>> Discipline.createStringField("Discipline_NameYear",  40, kUnique,
>> "Discipline_Name || Discipline_Year" )

ivc> thanks, this works:
ivc> Discipline.createStringField("Discipline_NameYear",  40, #kUnique,
ivc> "Discipline_Name || Discipline_Year" )

ivc> last suggestion:
ivc> I must keep the two fields "Discipline_Name" and  "Discipline_Year"  for
ivc> show distinct value to final user
ivc> and add a third 'method field' for check the unique of combine fields? ...
ivc> in this manner the db size augmented

There is only way for compose unique constraint for now.
But it is almost zero overhead.


-- 
Best regards,
 Ivan                            mailto:IvanSmahin at public.kherson.ua



More information about the Valentina-beta mailing list