Subject RE: [firebird-support] Command to duplicate a record in a table
Author Mentek
>> 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.

Why not ?

Regards, Bogdan


------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.67/2326 - Release Date: 08/26/09
12:16:00