ORA-03115: unsupported network datatype or representation
测试实例如下:
SQL> CREATE OR REPLACE FUNCTION factorial
2 ( n BINARY_DOUBLE ) RETURN BINARY_DOUBLE IS
3 BEGIN
4 IF n <= 1 THEN
5 RETURN 1;
6 ELSE
7 RETURN n * factorial(n - 1);
8 END IF;
9 END factorial;
10 /
函数已创建。
SQL> select factorial(4) from dual;
select factorial(4) from dual
*
ERROR 位于第 1 行:
ORA-03115: unsupported network datatype or representation
修改函数数据类型:
SQL> CREATE OR REPLACE FUNCTION factorial
2 ( n number ) RETURN number IS
3 BEGIN
4 IF n <= 1 THEN
5 RETURN 1;
6 ELSE
7 RETURN n * factorial(n - 1);
8 END IF;
9 END factorial;
10 /
函数已创建。
SQL> select factorial(4.0) from dual;
FACTORIAL(4.0)
--------------
24
SQL> select factorial(4) from dual;
FACTORIAL(4)
------------
24
居然没有报错了,跟数据类型有关?