Passing a Table Name as a Parameter

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ACS2000
Posts: 31
Joined: Thu 18 May 2006 11:10

Passing a Table Name as a Parameter

Post by ACS2000 » Thu 28 May 2009 10:37

Is it possible to pass a table name in to a TMyQuery component as a Parameter?

I have the following, but it complains that the table name is invalid.

SELECT
:Field
FROM
:Table
WHERE
:Field = :Cust_Code

I'm trying to iterate through all the tables in a Database searching for a specific Field to change its value.

Is this possible?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 28 May 2009 11:24

MySQL doesn't allow to pass table name as a parameter. For this you can use macros.
You can find more detailed information about macros in the MyDAC help.

ACS2000
Posts: 31
Joined: Thu 18 May 2006 11:10

Post by ACS2000 » Thu 28 May 2009 11:25

Ok, thanks.

Post Reply