当前位置: 代码迷 >> Oracle开发 >> Help:见内容,为何提示 “ORA-00900: 无效 SQL 语句”
  详细解决方案

Help:见内容,为何提示 “ORA-00900: 无效 SQL 语句”

热度:539   发布时间:2016-04-24 07:58:33.0
Help:见内容,为什么提示 “ORA-00900: 无效 SQL 语句”?
CREATE   OR   REPLACE   FUNCTION   F_GETPREJOBTIME   (CTABLE   IN   VARCHAR)
    RETURN   DATE   IS  
    RESULTS   USER_JOBS.LAST_DATE%TYPE;
BEGIN

    SELECT     LAST_DATE
    INTO     RESULTS
    FROM       USER_JOBS
    WHERE   WHAT   LIKE   CTABLE+ '% '  
    FOR   UPDATE   NOWAIT;
   
    IF   RESULTS   IS   NULL   THEN
          RETURN   (TO_DATE( '2007-01-01 ', 'yyyy-MM-dd '));
    ELSE
          RETURN(RESULTS);
    END   IF;
END   F_GETPREJOBTIME;
/

------解决方案--------------------
SELECT LAST_DATE
INTO RESULTS
FROM USER_JOBS
WHERE WHAT LIKE CTABLE+ '% '
FOR UPDATE NOWAIT;
-----------------------------------------
SELECT LAST_DATE
INTO RESULTS
FROM USER_JOBS
WHERE WHAT LIKE CTABLE || '% '
FOR UPDATE NOWAIT;