Author Topic: Sync one table with an other (alias-Table)  (Read 277 times)

0 Members and 1 Guest are viewing this topic.

Offline myloTopic starter

  • Irregular
    • View Profile
Sync one table with an other (alias-Table)
« on: November 22, 2008, 04:12:06 PM »
Hello,

my problem is, that i have a foreign mysql database which can't be changed. It contains some tables. What i want to do is to create a small subset of this database and use the values of it in my own, cleaner, table structure. My problem is, how to do this?
Should i use views, or triggers or what?
I don't want do change the content, only the fieldnames and the amount of them.

Offline Mchl

  • Freak!
  • Gender: Male
  • That's Largo in my avatar, not me.
    • View Profile
    • BOINC@Poland
Re: Sync one table with an other (alias-Table)
« Reply #1 on: November 22, 2008, 05:10:11 PM »
Read on FEDERATED storage engine
NetBeans fanatic | ExtJS masochist | C++ denier
PHP4 & MySQL4 are no longer supported.
PHPFreaks Tutorials | PHP Debugging: A Beginner's guide | PHP Security Tutorial || How To Ask Questions The Smart Way
Code: [Select]
import java;

Offline myloTopic starter

  • Irregular
    • View Profile
Re: Sync one table with an other (alias-Table)
« Reply #2 on: November 24, 2008, 05:32:23 AM »
Hm, maybe i get something wrong, but doc says:

"The structure of this table must be exactly the same as that of the remote table..."

which, in my case, is not the task. I need to be other than the source table.

Offline Mchl

  • Freak!
  • Gender: Male
  • That's Largo in my avatar, not me.
    • View Profile
    • BOINC@Poland
Re: Sync one table with an other (alias-Table)
« Reply #3 on: November 24, 2008, 05:36:47 AM »
I suppose, you would need to make a link to the remote table using FEDERATED engine, and then create a view, that would select those columns, that you need.

I am not really sure, never done something like that.
NetBeans fanatic | ExtJS masochist | C++ denier
PHP4 & MySQL4 are no longer supported.
PHPFreaks Tutorials | PHP Debugging: A Beginner's guide | PHP Security Tutorial || How To Ask Questions The Smart Way
Code: [Select]
import java;

Offline myloTopic starter

  • Irregular
    • View Profile
Re: Sync one table with an other (alias-Table)
« Reply #4 on: November 24, 2008, 06:06:56 AM »
To clarify things, i need to "mix" fields from an existing table with "translated" fieldnames into a table with my own fields.
Both tables reside on the same mysql server.

PHP Freaks Forums

« on: »

Tired of these ads? Purchase a supporter subscription to get rid of them.