1 insert into bas_auto_voucher_detail 2 select x.sys_id, 3 x.transatn_id, 4 x.track_id, 5 '13' auto_year , 6 x.auto_month, 7 x.track_id || '13'||x.auto_month|| '0001' start_no, 8 x.track_id || '13'||x.auto_month|| '0001' current_no, 9 x.track_id || '13'||x.auto_month|| 'Z999' max_no 10 from bas_auto_voucher_detail x 11 where x.auto_year = '12' 12 order by x.sys_id, x.transatn_id, x.track_id, x.auto_month
这样就可以写一个处理程序,直接形成下一年的自动编号初始化,为ERP中各类表单初始化新一年度的自动编码!
转载请注明:http://www.cnblogs.com/QQ308368388/archive/2012/10/16/2726903.html