Board index » delphi » Copying Records from a Table into the same Table

Copying Records from a Table into the same Table

Hi all.

I am working with Delphi 3 and Paradox 7. I have a table named "Protocols"
with the fields "IdProt" (key) , "Description" and others...

I need to make a copy from a record of "Protocols" in the same table
changing only
the "IdProt" field... Example:

                Before:   IdProt     Descritption
                                        1           Protocolo uno
                                        2           Protocolo dos

I copy first record:

                After:     IdProt     Descritption
                                        1           Protocolo uno
                                        2           Protocolo dos
                                        3           Protocolo uno

can I do this with a SQL sentence ?

Thanks in advance !!!

 

Re:Copying Records from a Table into the same Table


You could use a SQL INSERT query but it is probably faster and easier to
copy the fields to a variant array, insert a new record and copy the values
from the array to the new record.

Bill

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Other Threads