Oracle PL/SQLWarning: Function created with compilation errors.

前端之家收集整理的这篇文章主要介绍了Oracle PL/SQLWarning: Function created with compilation errors.前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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>

原文链接:https://www.f2er.com/oracle/212205.html

猜你在找的Oracle相关文章