select to_char(sysdate,'day') from dual;

解决方案 »

  1.   

    谢谢  ,对了还有几个问题能解答下吗? 比如:編寫一個函數,实现加減乘除的功能,要求有異常處理功能,兄弟必须得用orcale写哦
      

  2.   


    --Day of week (1-7). 1星期天,2星期一,3星期二...7星期六
    select to_char(sysdate,'D') ts from dual;
    --然后 case when那些你想怎么判断想怎么返回都可以了
      

  3.   

    create or replace function math(p_type   varchar2,
                                    p_param1 number,
                                    p_param2 number) return number is
      v_result number;
    begin
      if p_type = '+' then
        v_result := p_param1 + p_param2;
      elsif p_type = '-' then
        v_result := p_param1 - p_param2;
      elsif p_type = '*' then
        v_result := p_param1 * p_param2;
      else
        v_result := p_param1 / p_param2;
      end if;
      return v_result;
    exception
      when others then
        dbms_output.put_line(sqlerrm);
        return null;
    end math;