Link to home
Start Free TrialLog in
Avatar of Marius0188
Marius0188

asked on

Delphi TIBQuery Error

Hi Friends,

I have a TIBQuery component and receive an error when running my SQL query.
This is the SQL statement:
-----------------------------------SQL STATEMENT-------------------------------------
SELECT '+
    'CUSTOMEREMAILINID, CUSTOMERID, EMAILDATE, FROMEMAIL, HASREAD, MESSAGESOURCE, SUBJECT, TOEMAIL, ' +
    'COUNT(CUSTOMEREMAILINID) AS ROWCOUNT ' +
    'FROM '+
    'TBLCUSTOMEREMAILSIN ' +
    'WHERE ' +
    'CUSTOMERID = :CUSTOMERID ' +
    'GROUP BY '+
    'CUSTOMEREMAILINID, CUSTOMERID, EMAILDATE, FROMEMAIL, HASREAD, MESSAGESOURCE, SUBJECT, TOEMAIL '+
    'ORDER BY '+
    'EMAILDATE, CUSTOMERID
--------------------------------------------------------------------------------------------------

The error message I receive when opening the query is:
"conversion error from string 'BLOB' ".

Can someone please advice.

Thanks a million!
Avatar of Mike Littlewood
Mike Littlewood
Flag of United Kingdom of Great Britain and Northern Ireland image

Which of your fields is a BLOB field as if I remember right you can't use it as part of a GROUP
Avatar of Marius0188
Marius0188

ASKER

Field: MESSAGESOURCE  is ftBlob.

Also just as a side note I would not probably label a column as ROWCOUNT as this might be reserved.
ASKER CERTIFIED SOLUTION
Avatar of Mike Littlewood
Mike Littlewood
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TheRealLoki
I don't think you can use a blob in a "group by"
you could try declaring it as a memo type instead
Yeah thats why I re-wrote his query as a nested one just to bring back the blob field (if he doesnt need to group by it)