copy record, but set any field-values

Hi

I'd like to have a Stored Procedure who copy a record and set any
field-values in the new record.

X = GEN_ID(GEN_TABLEX,1);
INSERT INTO TABLEX SELECT * FROM TABLEX WHERE AUTOID = :AUTOID;
UPDATE TABLEX SET FIELDY = 'dsfdsfsdf' WHERE AUTOID = :X;

The problem is, that x (GEN_ID) perhaps not is the value which was created
with INSERT and if I remove the beforeinsert-trigger there is no unique
field.

How can I modify the INSERT-statement than this problem is resolved?

Thanks for your help.

Dominik F?ssler