3

I am using Delphi 2010 dbexpress components to connect to my MySQL database. I am facing a problem executing this query.

  SQLQuery1.SQL.Clear;
  SQLQuery1.SQL.Add('Select ForNo,Description from fortab');
  SQLQuery1.Open; 

It gives me an error saying
DBX Error :Unsupported field type.
now if I have the only 1 field in the query it will work fine i.e.

Select Description from fortab; 

or

Select ForNo from fortab;  

fortab structure 
    ForNo: int(10) unsigned  NOT NULL, Primary key
    Description: varchar(45) NOT NULL,
    ENGINE=InnoDB DEFAULT CHARSET=latin1;

Can anyone specify me the proper format of retrieving multiple fields from the table?
Or is it that I will have to write individual queries for each field?

14
  • Can you post the definition of your table? It's hard to say what your problem might be without it. What are the column names and data types? Commented Feb 17, 2012 at 5:01
  • @KenWhite have edited my question with table structure Commented Feb 17, 2012 at 5:12
  • Which version of MySQL and LibMySQL.dll are you using? Commented Feb 17, 2012 at 5:15
  • What is int(10)? I don't use MySQL, but an int should be an int, and shouldn't need a width specifier. Are you sure that's right? Commented Feb 17, 2012 at 5:15
  • @KenWhite int(10) is supported in MySQL. Commented Feb 17, 2012 at 5:35

1 Answer 1

1

Can anyone specify me the proper format of retrieving multiple fields from the table?

SELECT field1, field2, field3 FROM atable
WHERE field1 > 100
ORDER BY field1
Sign up to request clarification or add additional context in comments.

1 Comment

I know but its not working for me. I have tried the same query using BDE and MyDAC it works fine but when it comes to dbExpress it fails. Have also tried the same in BDS 2006 but no success.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.