Subject | Re: [firebird-support] Command to duplicate a record in a table |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2009-08-27T07:21:40Z |
> Anyway I have tried to use:May I suggest you to read something about SQL?..
>
> 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.
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.