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).

user938363
  • 97
  • 2
  • 11
  • 1
    Why don't you write a small bit of SQL? – Michael Hampton Dec 06 '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 06 '13 at 22:35

1 Answers1

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|
cjungel
  • 236
  • 2
  • 5