Subject RE: [firebird-support] Stored procedure ?
Author Alan McDonald
>
> Thanks again ....
> example :
> id, year, month,value1
> 01 2006 10 4
> 02 2006 10 3
> 03 2006 10 0
> after the procedure (procedure is run only once)
> id, year, month,value1
>
> 01 2006 10 4
>
> 02 2006 10 3
> 01 2006 11 4
>
> 02 2006 11 3
> I dont't want to use a tool for that,I thought to a stored
> procedure for a speed process,at least I'll do it with may
> application code.
>
> Thanks !
>

I think you are meaning to use the duplicate (not replicate)???
and you want to duplicate with incremented month value?
Replicate is a completely different thing in DB terminology (here anyway).

FOR SELECT ID, YEAR, MONTH, VALUE FROM MYTABLE INTO :ID, :YEAR, :MONTH,
:VALUE DO BEGIN
INSER INTO MYTABLE(ID, YEAR, MONTH, VALUE) VALUES (:ID, :YEAR, :MONTH+1,
:VALUE);
END

I assume you have a surrogate PK which is not ID
Alan