如果每天都不超过三位,每天都从001开始:declare 
    i_temp number;
    v_char varchar2(100);
begin
    select substr(a,11) into v_char fron samp;
    i_temp:=to_number(v_char)+1;
    insert into samp values(to_char(sysdate,'yyyymmdd')||ab||to_char(i_temp), , );
    commit;
    exception 
        when others then 
           rollback;
end;