Toad World® Forums

Missing option CONNECTION string for FEDERATED tables


#1

Hi,

There doesn’t seem to be an option for defining the CONNECTION string for FEDERATED objects.


#2

Hello,

What is the database?
Thanks.

Vladka


#3

MySQL 5


#4

Thanks. :slight_smile:

I’ve created a new CR for this - # 44 528.

If you need it now, you can write e.g.:

ALTER TABLE tablename
CONNECTION = ‘string’;

to the After Script tab of an entity.

Regards,

Vladka + Mario


#5

Unfortunately this after script sollution won’t work.

A create table of a FEDERATED table REQUIRES the CONNECTION option to be present at table creation time. Otherwise MySQL returns the following error and the table is not created:

Can’t create federated table. The data source connection string ‘’ is not in the correct format.

PS
As of version 5.1 there is a CREATE SERVER statement available to create an alias for a remote database connection which can be reused in the CONNECTION option for a CREATE TABLE statement.

EDIT
I could create the table in another storage engine (eg myisam) and in the after script change the storage engine of the table along with the connection. That will work fine, thanks! I wasnt aware of the fact that the storage engine of a table could be changed with ALTER TABLE.

Message was edited by: Schnaaf


#6

Happy to hear that you solved the trouble.

Have a nice day.

Vladka + Mario


#7

It turns out that the following statement:

ALTER TABLE t1 ENGINE=FEDERATED CONNECTION=‘connectionString’

generates an SQL error executed on a MyISAM table. So at this moment it is impossible for me to generate the federated objects.

Message was edited by: Schnaaf


#8

OK I got it now, but it’s an ugly sollution.

I have abused the “Initial AUTO_INCREMENT” field on the “General” tab for this purpose.
I filled it with the value “0 CONNECTION=‘connect_string’”. That generates the table as it should.


#9

Schnaaf, thanks very much for your updates.
We appreciate it very much.

Just a quick note to let you know that we keep this issue in mind and will solve it (CR # 44 528). However, just need some time.

Thanks.

Vladka


#10

Vladka, thanx for your update. Just wanted to share this with the community. This workaround will work fine untill this is picked up by the TDM team.

Keep up the good work. This tool is great!


#11

Just a quick update: CR # 44 528 solved for next version 3.1 (will be released by the end of Q1/2008).

Vladka