加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Oracle PL/SQLWarning: Function created with compilation erro

发布时间:2020-12-12 15:51:22 所属栏目:百科 来源:网络整理
导读:How to handle "Warning: Function created with compilation errors." when create Oracle function. For example (MYFUNC.sql): 1 CREATE OR REPLACE FUNCTION MYFUNC 2 RETURN NUMBER AS 3 MYVAR NUMBER; 4 BEGIN 5 SELECT COUNT(*) INTO MYVAR FROM MYTA

How to handle "Warning: Function created with compilation errors." when create Oracle function.


For example (MYFUNC.sql):

1 CREATE OR REPLACE FUNCTION MYFUNC

2 RETURN NUMBER AS

3 MYVAR NUMBER;

4 BEGIN

5 SELECT COUNT(*) INTO MYVAR FROM MYTAB;

6 RETURN MYVAR;

7 END MYFUNC;

8 /


$ sqlplus $LOGIN @MYFUNC.sql


SQL*Plus: Release 12.1.0.1.0 Production on Mon May 25 00:26:09 2015


Copyright (c) 1982,2013,Oracle. All rights reserved.



Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning,OLAP,Data Mining and Real Application Testing options



Warning: Function created with compilation errors.


SQL>

SQL> show errors;

Errors for FUNCTION MYFUNC:


LINE/COL ERROR

-------- -----------------------------------------------------------------

5/3 PL/SQL: SQL Statement ignored

5/35 PL/SQL: ORA-00942: table or view does not exist

SQL>


It's mean that table MYTAB does not exists.


SQL> CREATE TABLE MYTAB(A INT);


Table created.


SQL> @MYFUNC.sql


Function created.


SQL>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读