依次为:
to_char(sysdate,'d')
to_char(sysdate,'dd')
to_char(sysdate,'ddd')
to_char(sysdate,'ww')
to_char(sysdate,'mm')
to_char(sysdate,'q')
to_char(sysdate,'yyyy')

解决方案 »

  1.   

    try:
    declare
    v_dt date:=to_date('2000-01-01','yyyy-mm-dd');
    i number:=1;
    begin
    while v_dt<to_date('2007-01-01','yyyy-mm-dd') loop
    insert into tbname values(i,v_dt,
    to_char(v_dt,'d'),
    to_char(v_dt,'dd'),
    to_char(v_dt,'ddd'),
    to_char(v_dt,'ww'),
    to_char(v_dt,'mm'),
    to_char(v_dt,'q'),
    to_char(v_dt,'yyyy')
    );
    i:=i+1;
    v_dt:=v_dt+1;
    end loop;
    commit;
    end;
    /