How to move record from one table to another one within same DB

Hi, All

What I'm trying to do here is move a specific record in table A to a history table called A_HIS. The only differece between these two tables are A_HIS has two extra fields that record the insertion time and user. All the rest of fields are the same.

Since table A has more than 40 fields and it would be very time consuming to set every field and run an insert. Can anyone give me a suggestion please? Thanks a lot!

kiki

[454 byte] By [kikibosa] at [2007-11-27 10:17:16]
# 1

You could try something like this:

INSERT INTO t1 (t1c1,t1c2, t1c3 ...) SELECT t2c1, t2c2, t2c3 ... FROM t2;

Not sure how portable that is.

dcmintera at 2007-7-28 15:50:33 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...