From: Mike Watson Date: March 29 1999 6:32pm Subject: Copying records from a table and re-inserting them List-Archive: http://lists.mysql.com/mysql/1155 Message-Id: <000701be7a12$8be42fa0$7079b9d1@mwatson.onradio.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I'm using Perl DBI to manage a set of MySQL tables. I want to copy a set of records from a table and re-insert them with a new radio station id. Selecting the set of records is no problem, but there is no equivalent of the SELECT * for the insert command (INSERT INTO *). What I have done is used show columns to get a list of field names and from this built a string for the insert command. I don't want to change any timestamp values, which I don't because I reference those fields in the insert string. I have had to look at field types and escape special chars in text fields. Now I have hit another wrinkle. We use a seperate id field as a primary key so I don't want to insert this value, I want the data base automatically pick a value for this field. Again, I can do this. Is there an easier way? Thanks Michael Watson Internet Product Engineering Manager OnRadio, Inc. 1500 Green Hills Road Scotts Valley, CA 95066 http://www.onradio.com mwatson@stripped 1-831-440-0300 ext 185