Exporting/importing table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ville Rontti

    #1

    Exporting/importing table

    Hi

    I have two separate databases (A and B). Both databases have one table (A).
    How I could transfer the contents of table A from Database A to database B
    table A? The tables are same.

    Ville


  • Erik Tank

    #2
    Re: Exporting/importing table

    On Sun, 18 Jan 2004 14:58:21 GMT, "Ville Rontti"
    <ville.rontti@p p.inet.fi> wrote:
    [color=blue]
    >Hi
    >
    >I have two separate databases (A and B). Both databases have one table (A).
    >How I could transfer the contents of table A from Database A to database B
    >table A? The tables are same.
    >
    >Ville
    >[/color]

    Do the tables have a unique identifier?

    If not then you can just use mysqldump to dump table A, make sure that
    it doesn't try to recreate the table, use awk, sed, vi, etc to change
    each reference of table A to table B, then reload the data.

    If it does then you will probably have to write a program that simply
    takes all the information form A (minus the unique identifier) and
    inserts it into B.

    Comment

    • Erik Tank

      #3
      Re: Exporting/importing table

      On Sun, 18 Jan 2004 14:58:21 GMT, "Ville Rontti"
      <ville.rontti@p p.inet.fi> wrote:
      [color=blue]
      >Hi
      >
      >I have two separate databases (A and B). Both databases have one table (A).
      >How I could transfer the contents of table A from Database A to database B
      >table A? The tables are same.
      >
      >Ville
      >[/color]

      Do the tables have a unique identifier?

      If not then you can just use mysqldump to dump table A, make sure that
      it doesn't try to recreate the table, use awk, sed, vi, etc to change
      each reference of table A to table B, then reload the data.

      If it does then you will probably have to write a program that simply
      takes all the information form A (minus the unique identifier) and
      inserts it into B.

      Comment

      • Ville Rontti

        #4
        Re: Exporting/importing table

        "Erik Tank" <erik@jundy.com > wrote in message
        news:15eb9f14a0 2c9bd5bef5c636c f052fc6@news.te ranews.com...[color=blue]
        > On Sun, 18 Jan 2004 14:58:21 GMT, "Ville Rontti"
        > <ville.rontti@p p.inet.fi> wrote:
        >[color=green]
        > >Hi
        > >
        > >I have two separate databases (A and B). Both databases have one table[/color][/color]
        (A).[color=blue][color=green]
        > >How I could transfer the contents of table A from Database A to database[/color][/color]
        B[color=blue][color=green]
        > >table A? The tables are same.
        > >
        > >Ville
        > >[/color]
        >
        > Do the tables have a unique identifier?
        >
        > If not then you can just use mysqldump to dump table A, make sure that
        > it doesn't try to recreate the table, use awk, sed, vi, etc to change
        > each reference of table A to table B, then reload the data.
        >
        > If it does then you will probably have to write a program that simply
        > takes all the information form A (minus the unique identifier) and
        > inserts it into B.[/color]

        The table has unique identifier. Now we are just "filling" the tables with
        information. Both tables will have same information. That is why we like to
        have copy the contents of table A from database A to database B to table
        A... So, mysqldump you said? Does it create file that I can copy to the
        other database?

        Ville


        Comment

        • Ville Rontti

          #5
          Re: Exporting/importing table

          "Erik Tank" <erik@jundy.com > wrote in message
          news:15eb9f14a0 2c9bd5bef5c636c f052fc6@news.te ranews.com...[color=blue]
          > On Sun, 18 Jan 2004 14:58:21 GMT, "Ville Rontti"
          > <ville.rontti@p p.inet.fi> wrote:
          >[color=green]
          > >Hi
          > >
          > >I have two separate databases (A and B). Both databases have one table[/color][/color]
          (A).[color=blue][color=green]
          > >How I could transfer the contents of table A from Database A to database[/color][/color]
          B[color=blue][color=green]
          > >table A? The tables are same.
          > >
          > >Ville
          > >[/color]
          >
          > Do the tables have a unique identifier?
          >
          > If not then you can just use mysqldump to dump table A, make sure that
          > it doesn't try to recreate the table, use awk, sed, vi, etc to change
          > each reference of table A to table B, then reload the data.
          >
          > If it does then you will probably have to write a program that simply
          > takes all the information form A (minus the unique identifier) and
          > inserts it into B.[/color]

          The table has unique identifier. Now we are just "filling" the tables with
          information. Both tables will have same information. That is why we like to
          have copy the contents of table A from database A to database B to table
          A... So, mysqldump you said? Does it create file that I can copy to the
          other database?

          Ville


          Comment

          • Ville Rontti

            #6
            Re: Exporting/importing table

            "Erik Tank" <erik@jundy.com > wrote in message
            news:15eb9f14a0 2c9bd5bef5c636c f052fc6@news.te ranews.com...[color=blue]
            > On Sun, 18 Jan 2004 14:58:21 GMT, "Ville Rontti"
            > <ville.rontti@p p.inet.fi> wrote:
            >[color=green]
            > >Hi
            > >
            > >I have two separate databases (A and B). Both databases have one table[/color][/color]
            (A).[color=blue][color=green]
            > >How I could transfer the contents of table A from Database A to database[/color][/color]
            B[color=blue][color=green]
            > >table A? The tables are same.
            > >
            > >Ville
            > >[/color]
            >
            > Do the tables have a unique identifier?
            >
            > If not then you can just use mysqldump to dump table A, make sure that
            > it doesn't try to recreate the table, use awk, sed, vi, etc to change
            > each reference of table A to table B, then reload the data.
            >
            > If it does then you will probably have to write a program that simply
            > takes all the information form A (minus the unique identifier) and
            > inserts it into B.[/color]

            The table has unique identifier. Now we are just "filling" the tables with
            information. Both tables will have same information. That is why we like to
            have copy the contents of table A from database A to database B to table
            A... So, mysqldump you said? Does it create file that I can copy to the
            other database?

            Ville


            Comment

            Working...