Subject Re: [firebird-support] Command to duplicate a record in a table
Author Dimitry Sibiryakov
> Anyway I have tried to use:
>
> FOR SELECT a.DID
> FROM DETAIL a
> WHERE a.HID = "A"
> INTO :vDID
> DO
> INSERT INTO DETAIL (HID, DID, TOTAL) SELECT "C", a.DID, a.TOTAL FROM DETAIL a WHERE a.HID = "A" AND a.DID = :vDID;
>
> and it worked.
>
> But I am open for any suggestion.

May I suggest you to read something about SQL?..
What prevent you from using simple "INSERT INTO DETAIL (HID, DID,
TOTAL) SELECT "C", a.DID, a.TOTAL FROM DETAIL a WHERE a.HID = "A""? Why
you decided to use Stored Procedure at all?

SY, SD.