Subject Re: [IBO] How to do a Row Duplicate
Author Russell Belding
""Artur Anjos"" <arsoft@...> wrote in message
news:001301c14b2a$0d67ca60$0200a8c0@......
> Hy list,
>
> Is there a simple way in IBO to duplicate a row?
>

Suppose you have MyTable with a primary key PriKey and fields Field01,
Field02. An Interbase procedure
MakeNewRow(old_Key integer, new_Key integer)
as
begin
insert into MyTable
SELECT :new_Key, Field01, Field02
from MyTable where PriKey = :old_Key
end

will do what you want.

Regards

Russell

> What I want to do it's let the user select a row, and create a new row
that get's all values from this one, and let the user change that values.
It's like to have a Edit act as a Append/Insert. For now, I'm creating a
temporary buffer with the values from the row, do an Append and copy the
values back.
>
> I wonder if there is a better way, a some kind of flag that we can change
that tells IBO that this will be a new record.
>
> Thanks in advance,
>
> Artur Anjos
> http://www.arsoft.pt
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>