Hi

I'm stuck with a sequence of sql commands to duplicate a  record whithin the 
same table (server is 3.23.58):

I have table t1 with data : char and id: auto_increment, int, unsigned, primary 
key.
I would like to do the following

SET @template = 104;
DROP table IF EXISTS tmp; 

CREATE TABLE tmp 
SELECT data
FROM t1
WHERE [EMAIL PROTECTED];

INSERT INTO t1 (id, data)
SELECT null as id, tmp.data
FROM tmp;

And I always get 0 rows inserted.

By the way last_insert_id() gives something meaningfull: the id is incremented, 
but the other fields are left empty.

I there a way to get this working with that server version ?

Thanks for any help

François Rappaz

Centre de documentation de la Faculté des Sciences 
Université de Fribourg
DokPe - Dokumentationszentrum der Naturwissenschaftlichen Fakultät Universität 
Freiburg 
Pérolles CH-1700 Fribourg Switzerland
http://www.unifr.ch/dokpe/
Tel.: 41 (0)26 300 92 60 
Fax.: 41 (0)26 300 97 30

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to