Announcement

Collapse
No announcement yet.

Query using 2 different database with 2 different host ?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Query using 2 different database with 2 different host ?

    How do you make query with 2 different database and 2 different host ?

  • #2
    You can set two different connections. Problem is that you cannot create a sql query over two different databases. So you have to find a workaround which might be dependent on your database. Sometimes you can merge the two databases to one pool, sometimes you need to do your query and store result as a temp table in your other db. It depends.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      I don't know if this one is bug or not, but i managed to query using 2 databse in the same server using [database_name].table_name.

      But yes, the real problem when the databse in the different server.

      Thanks albert

      Comment


      • #4
        If the database is on a different server you can always make a federated table (mysql only). Other databases usually have simialr solutions. See http://en.wikipedia.org/wiki/MySQL_Federated

        Comment


        • #5
          Nice info rr,

          But using federated table, we need to create an identical table in the local and remote server. I don't see this one is the solution since the database hierarchy i design is :
          - database_master on host A
          - database_company_transaction on host B
          - database_company_transaction on host C

          Any other idea ?

          Comment


          • #6
            If it is three times the same database structure then I dont really see the problem. Apart from that I would make 3 windows one for each database...
            But I guess I dont have enough info to conclude that....
            The data is not replicated I thought that that was what you wanted.

            Comment


            • #7
              Originally posted by rr View Post
              If it is three times the same database structure then I dont really see the problem. Apart from that I would make 3 windows one for each database...
              But I guess I dont have enough info to conclude that....
              The data is not replicated I thought that that was what you wanted.
              The problem is when we do query, because the master data / information is in different host.

              Comment


              • #8
                what if you want to connect to a completely different database from the one .

                Onilne Casino australia
                Last edited by josephstevens; 06-26-2014, 06:48 AM.

                Comment

                Working...
                X