[V4MD] unique between two fields

Ivan Smahin IvanSmahin at public.kherson.ua
Sun Nov 6 11:07:58 CST 2005


Hello info,

Sunday, November 6, 2005, 10:44:29 AM, you wrote:

ivc> Hi Ivan,

ivc> and if I have one (or more) UShortField together stringFields what is the
ivc> correct way or value thay I must use?

ivc> in eg look at  36 + ?

ivc> Discipline = gDb.createTable("Discipline ")
ivc> Discipline .createStringField("Discipline_Name",  36)
ivc> Discipline .createUShortField("Discipline_Teacher_ID")
ivc> Discipline .createUShortField("Discipline_Room_ID")

ivc> Discipline .createStringField("Discipline_NameTeacherRoom", 36+?  ,
ivc> [#fUnique],
ivc> "Discipline_Name || Discipline_Teacher_ID ||  Discipline_Room_ID" )

Actually   it   depends  on  your  task.  Generally  ushort's  string
representation  could  be 5 symbols length ("65535"). But if you think
that it would be only 4-digit values you could use 36+4.

Anyway if the resulting string does not feet into the resulting field
it will be just cut off.

Example:

create  table t1 ( f1 string(2), f2 ushort, m1 string(4) Method('f1 ||
f2') )

insert into t1 (f1, f2) values ( 'aa', 11 )
insert into t1 (f1, f2) values ( 'aa', 222 )
insert into t1 (f1, f2) values ( 'aaa', 33 )
insert into t1 (f1, f2) values ( 'aaaa', 444 )

select ** from t1
.... m1
--------
      aa11
      aa22
      aa33
      aa44
      
-- 
Best regards,
 Ivan                            mailto:IvanSmahin at public.kherson.ua



More information about the Valentina-beta mailing list