Maximum Length of any Field
Peter De Berdt
peter.de.berdt at pandora.be
Wed Nov 12 14:33:09 CST 2003
>>Once again. Right now Valentina do NOT provide function that all in SQL
>>query define max length of column.
>>
>As as far as I know any other DB also do not do this.
Using your advice, I obtained what I wanted by creating a new
ULongField for every field that is used in lists and attached a
BaseObject method to it that holds the length of the field.
myLenghtfield=new VULong("myLengthField")
myLengthfield.setmethod("LENGTH(myField)")
I then queried the DB using:
"SELECT myField FROM myTable ORDER BY myLengthField DESC"
The first record reflects the longest string, of which I then take
the stringwidth. And without too much speed loss, even when searching
60,000 records.
--
Best regards,
Peter De Berdt
--------------
My software never has bugs, it just generates random features...
More information about the Valentina
mailing list