Alex du Plessis wrote:
Would anybody know why a sqldb query (TSQLQuery) has a problem reading an aggregate field? I cannot get the query to read an aggregate field for love or money. It complanis that it cannot find the fieldname (query.FieldbyName('sum').asInteger) or that the index(query.Fields[i].asInteger) is out of range.

The query syntax is correct and i can read the result when running it in PGAdmin.

Still, I recommend you copy & paste the relevant parts of the code here! 
(Relevant is the code that assigns/builds the query up to the part that tries to 
read the Field.)

I haven't had any problems accessing aggregate fields with TSQLQuery (using 
TODBCConnection), and I consider it unlikely the PostGres component has a 
problem with this.

A few shots in the dark:
- does the code work with query.ParseSQL := false ?
- can it read the other fields from the query ?
- what is the content of the query just before the call to Execute (or what is 
in the logs of PostGres?)

Bram

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to