bytes or chars ?

Robert Brenstein rjb at robelko.com
Thu Sep 16 22:46:18 CDT 2004


>On 9/16/04 7:21 PM, "Robert Brenstein" <rjb at robelko.com> wrote:
>
>>  a)
>>
>>  For fields, we have Field_GetLength (should really be GetMaxLength).
>>
>>  It will, after change, return the number of bytes not chars as you say.
>>
>>  For BLOB fields, we have BLOB_GetDataSize.
>>
>>  This already returns number of bytes.
>>
>>  I am suggesting Field_GetDataSize (generalized version of
>>  BLOB_GetDataSize) and Field_GetCharCount so I can know how much
>>  data/chars is in a given VarChar or Text field.
>
>Why you need Field_GetCharCount() ?

For example, I want to know the average and max length of a field 
with textual description for a report. I do not need to report the 
actual descriptions.

This is not abstract. I had a client last year for whom I wrote a 
conference registration and abstract system. The latter required 
carefully counting chars during submission and I had to produce 
reports on those counts.

>  > Is it unreasonable to inquire this (if needed) instead of actually
>>  fetching the data into a local variable and counting in my code?
>
>But you in any case will fetch data.

I gather you mean that data will be pulled out of database in either 
case. True. However, it is different when the kernel does it 
internally or whether it passes it over to me (particularly in case 
of vxcmd and also server). In the example above, I don't care what 
the data in the field actually is. I care only about char count.

Robert


More information about the Valentina-beta mailing list