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:
-------------------------- ---------S QL 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!
I have a TIBQuery component and receive an error when running my SQL query.
This is the 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!
Which of your fields is a BLOB field as if I remember right you can't use it as part of a GROUP
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't think you can use a blob in a "group by"
you could try declaring it as a memo type instead
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)