/*ALIAS>prop_db*/

/*SQLStart>2512*/
create procedure MoveAddNums
as
declare variable docId integer;
declare variable docAddNum varchar(100);
begin
    FOR
        SELECT DOC_ID, doc_addnum
        FROM DOCUMENTS
        WHERE (DOC_LEADDOCID is null) or (DOC_LEADDOCID <= 0)
        INTO :docId, :docAddNum
   DO
   BEGIN
        UPDATE DOCUMENTS doc
        set doc.doc_addnum = :docAddNum
        where doc.doc_leaddocid = :docId;
   END

  suspend;
end
/*SQLStop*/

/*SQLStart>2513*/
execute procedure moveaddnums;
/*SQLStop*/

/*ManyStart>2514*/
drop procedure moveaddnums;
/*ManyStop*/

/*SQLStart>2515*/
update system_strings set sys_str = '6.7.199.1' where sys_id = 1401;  /*BackOffice*/
/*SQLStop*/
