遇到符号创建oracle存储过程

时间:2013-10-06 12:54:39

标签: oracle stored-procedures

下面的oracel程序一直向我显示“pls-00103遇到符号创建”,我不知道为什么......请帮忙

create or replace procedure myproc
    (
    otherdate in varchar2
    )
    as
    mystringdate varchar2(20);

    begin
    create or replace function checkdate(givdate in varchar2) return number
    as
    givedate1 date;
    begin
    givedate1 := todate(givdate);
    return1;
    exception
    when others then 
    return 0;
    end;       

    mystringdate := ltrim(rtrim(otherdate));

    if checkdate(mystringdate,'dd-mm-yyyy')= 1 then        
     DBMS_OUTPUT.PUT_LINE('it is a date format');         
    else        
     DBMS_OUTPUT.PUT_LINE('it is not a date format');        
    endif        
    end myproc;

我尝试了更多像\符号和所有但不工作。请帮忙

1 个答案:

答案 0 :(得分:0)

这很奇怪,你开始创建一个proc然后在里面开始创建函数,你需要从那里删除create function。你为什么要那样做?

删除它:

create or replace function checkdate(givdate in varchar2) return number
    as
    givedate1 date;
    begin
    givedate1 := todate(givdate);
    return1;
    exception
    when others then 
    return 0;
    end;