Subject Re: [IBO] How to do a Row Duplicate
Author Artur Anjos
Thanks Russel,

But I need this in the client, not in the Server. (I need to provide my users a easy way to create one product very simmilar to the other, for example. Imagine that the product is "Hard Disk XPTO 10Gb" and the user needs to create "Hard Disk XPTO 20Gb", "Hard Disk XPTO 30Gb"). Marcus send me a solution using RowData, but I did not have time to test it. Here he goes:

sRowData: String;
sRowData := Qry.Fields.RowData;
Qry.Fields.RowData := sRowData;
Qry.FieldByName( 'PrimaryKey' ).AsInteger := Qry.GeneratorValue(
'Gen_PrimaryKey', 1 );


----- Original Message -----
From: Russell Belding
Newsgroups: egroups.ibobjects
Sent: Thursday, October 04, 2001 8:09 AM
Subject: Re: [IBO] How to do a Row Duplicate

""Artur Anjos"" <arsoft@...> wrote in message
> 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)
insert into MyTable
SELECT :new_Key, Field01, Field02
from MyTable where PriKey = :old_Key

will do what you want.



> 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
> [Non-text portions of this message have been removed]
> Your use of Yahoo! Groups is subject to

Yahoo! Groups Sponsor

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

[Non-text portions of this message have been removed]