Sql Oracle函数已成功编译,但在执行PLS-00221时引发错误:不是过程或未定义

Sql Oracle函数已成功编译,但在执行PLS-00221时引发错误:不是过程或未定义,sql,oracle,stored-procedures,plsql,sql-function,Sql,Oracle,Stored Procedures,Plsql,Sql Function,我有简单的oracle函数 create or replace function abs.test_func(test_in in number) return number is test_out number ; BEGIN test_out:=test_in; RETURN test_out; END; 如果我编译它-它编译成功。 但是当我从PLSQL开发者SQL窗口运行时 BEGIN abs.test_func(5); END; 如果我得到以下错误 ORA-06550: li

我有简单的oracle函数

create or replace function abs.test_func(test_in in number)
return number
is
   test_out number ;
BEGIN
test_out:=test_in;
RETURN test_out;
END;
如果我编译它-它编译成功。 但是当我从PLSQL开发者SQL窗口运行时

 BEGIN abs.test_func(5); END;
如果我得到以下错误

ORA-06550: line1, column8;
PLS-00221: 'TEST_FUNC' is not a procedure or is undefined
ORA-06550: line1, column8;
PL/SQL: Statement ignored

我的函数有什么问题?

您的
创建函数
代码看起来不错,但是您没有正确调用该函数。函数返回某些内容,您必须选择、分配、打印或计算这些内容

以下是一些有效函数调用的示例:

-- print the return value
begin
    dbms_output.put_line(test_func(5));
end;
/

1 rows affected

dbms_output:
5


-- select the return value
select test_func(5) from dual;

| TEST_FUNC(5) |
| -----------: |
|            5 |

如何运行函数?这将有助于您展示运行函数的代码。您是在执行函数的同一用户上创建函数的模式/用户(abs)?我从PLSQL Developer调用它,更新了我的问题。过程和函数是两件不同的事情。您能写一个简单的示例吗?我如何从c调用它?