0

We are looking for db management software which can copy from one sqlite3 table to another for fields which are common to both tables. For example, if table A has column name and address. Table B has name , address and contact. The db management software can copy column name and address from table A to table B or vise verse.

The db management software we found can only copy when 2 tables have exactly the same structure (field name).

  • 1
    Why don't you write a small bit of SQL? – Michael Hampton Dec 6 '13 at 22:14
  • I would use Perl. The problem you are going to face with this is that even if fields are basically data, the datatypes MUST match the data that is being written to them. Now, use some magic with Perl and DBI, and you can probably do anything you like in this area. I know I do a lot of that kinda stuff. – Eirik Toft Dec 6 '13 at 22:35
2

Like it was suggested in the comments why not use some SQL.

sqlite> CREATE TABLE "a" (
   ...>     "name" TEXT,
   ...>     "address" TEXT
   ...> )
   ...> ;
sqlite> INSERT INTO "a" ("name","address") VALUES ("john","paris");
sqlite> INSERT INTO "a" ("name","address") VALUES ("peter","london");
sqlite> CREATE TABLE "b" (
   ...>         "name" TEXT,
   ...>         "address" TEXT,
   ...>         "contact" TEXT
   ...>     );
sqlite> INSERT INTO "b" ("name","address") SELECT "name","address" FROM "a";
sqlite> SELECT * FROM "b";
john|paris|
peter|london|
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.