tags:

views:

47

answers:

2

I'm debugging an old application in Delphi 5, connected with a recent version of MySql via ODBC connector. When using a CAST conversion function, even the following query:

select cast(1 as char)

returns an empty column without column name. If I run the query directly into the mysql query analyzer it runs fine, so I suppose the problem is in the ODBC connector or in BDE.

A: 

Try using an alias column. An alias can be used in a query select list to give a column a different name.

Select cast(1 as char) AS MyColumnName
RRUZ
I've tried but it didn't work
Guille
A: 

The only information I can find on this is this (emphasis mine):

Connector/ODBC erroneously reported that it supported the CAST() and CONVERT() ODBC functions for parsing values in SQL statements, which could lead to bad SQL generation during a query.

Could it be that the connector does not support CAST at all?

Pekka
It could be, but it's the last version, downloaded from the mysql site. I don't know. In order to isolate the problem, i'll move the cast to a view in the database.
Guille