How to copy record in same table?

Frank Boudreau

New Member
HI,

I'm trying to get a copy of a record in the same table...

I wanna use temp-table but can we do something like this?

/* suppose to get an exact copy of the fied */
DEF VAR TEMP-TABLE tmpTab LIKE MyTable

FIND FIRST MyTable no-lock no-error.

/* error : unknown field or variable tmpTab on next line */
tmpTab = MyTable.

How can I get a copy of a record to change one or two field ?
I dont want the user write again 50 field when they only have to change 1 field in each record.
I want to know the best way to do this...
 
Frank, the buffer-copy command will do what you need.
The following ought to get you going.

create tmptbl.
buffer-copy mytable to tmptable
except
field1
field2.

update
tmptable.field1
tmptable.field2
with some nicely defined frame.

Mark.

Frank Boudreau said:
HI,

I'm trying to get a copy of a record in the same table...

I wanna use temp-table but can we do something like this?

/* suppose to get an exact copy of the fied */
DEF VAR TEMP-TABLE tmpTab LIKE MyTable

FIND FIRST MyTable no-lock no-error.

/* error : unknown field or variable tmpTab on next line */
tmpTab = MyTable.

How can I get a copy of a record to change one or two field ?
I dont want the user write again 50 field when they only have to change 1 field in each record.
I want to know the best way to do this...
 
Back
Top