[Lazarus] MySQL5.1 and Sum(DataLength(FIELD))

Joost van der Sluis joost at cnoc.nl
Sun Oct 17 03:04:30 CEST 2010


On Sat, 2010-10-16 at 19:49 -0500, Andrew Brunner wrote:

You forgot to tell what you are doing?

> The resulting field does not parse right.

Parse? Are you using the sql-parser?

> If I execute or open the following SQL statement

Hmm.. probably not. Or are you accessing the MySQL api directly so that
you have to parse something? Or are you just using ZEOS or maybe SQLDB
and a TSQLQuery?

> SELECT SUM(LENGTH(ITMDAT)) as TesT FROM scms_ufls WHERE ITMUID=2 AND ITMKND=1
> 
> the FieldDef come back with FieldDefs count =1
> The name looks good.

Fielddef <> Fields. So what is the field-count?

> But if I try to access Query.Fields[0] or so, it does not exist. 

It does not exist? Do you get an error-message 'Field does not exist'? 

>  1
> field was supposed to be added when I build a query to
> sum(datalength(FIELD_NAME)) or even using the as LOCAL_FIELD_NAME
> should be respected to.

Please give some more info, maybe that I can help if you do. ;)

Joost.





More information about the Lazarus mailing list