Subject | Re: [IBO] Copying rows with executable procedures |
---|---|
Author | Paul Vinkenoog |
Post date | 2005-03-03T12:29:43Z |
Hi yaedos2000,
insert into table_2 select data from table_1 where id = :something
will copy all the matching rows. No loop needed.
Greetings,
Paul Vinkenoog
> I'm trying to use an executable procedure to copy a row from oneThis is actually not an IBO question, but the answer is short:
> table to another. What's the best way of doing this? I'm currently
> trying to use a SELECT statement to read the row, then an INSERT to
> add it to the other table.
>
> for
> SELECT DATA FROM TABLE_1 WHERE ID = :SOMETHING INTO :LOCAL_VARIABLE
> do
> begin
> INSERT INTO TABLE_2 VALUES (:LOCAL_VARIABLE)
> end
>
> but this isn't working. Is there a better way of doing this, like a
> specific function for copying rows?
insert into table_2 select data from table_1 where id = :something
will copy all the matching rows. No loop needed.
Greetings,
Paul Vinkenoog