Page 1 of 1

Maybe OT: OrdCreate with Unique Clausule

Posted: Thu Apr 28, 2016 12:09 am
by hidroxid
Hi all

Any one has used OrdCreate( ... ) with the UNIQUE clausule and work as expected ?

Help say: OrdCreate(<cOrderBagName>,[<cOrderName>],<cExpKey>, <bExpKey>, [<lUnique>])

But when use with lUnique .T. nothing happens

Sorry if is Off Topic

Regards

Re: Maybe OT: OrdCreate with Unique Clausule

Posted: Thu Apr 28, 2016 12:27 am
by nageswaragunupudi
I used unique indexes and they work the way they are expected to work.
I use command syntax

INDEX ON <expr> TAG <tagname> UNIQUE

Re: Maybe OT: OrdCreate with Unique Clausule

Posted: Thu Apr 28, 2016 8:02 am
by ukoenig
hidroxid,

I'm using it in some complicated situations

a sample

The index :

cUnique := cRMonat + "P" // cRmonat can be January - Dezember 12 different DBF

ORDCREATE( ,cUnique, "UPPER(PAT_NNAME + PAT_VNAME)", ;
{|| UPPER(PAT_NNAME + PAT_VNAME) } , .T. )
// .T. = UNIQUE

ORDCREATE( ,cRMonat, "UPPER(PAT_NNAME + PAT_VNAME)", ;
{|| UPPER(PAT_NNAME + PAT_VNAME) } , .F. )


It is the same DBF but opend twice. Once with a UNIQUE on NAMES
and the 2. with a normal index on NAMES

The result :

The left browser-sample -> NO unique
The right browser-sample -> UNIQUE

The upper browser UNIQUE is needed
The lower browser is related to brower 1

Image

I hoĆ¼pe it helps

regards
Uwe :D

Re: Maybe OT: OrdCreate with Unique Clausule

Posted: Thu Apr 28, 2016 11:54 am
by hidroxid
I have to check my source carefully because in an example that would send to your..... it worked :shock: , then the problem is not the function the problem is me lol :D

Thanks so much!