请考虑以下代码(query.sql):
create or replace function age (dateOfBirth date)
return number
is
mAge number(5,2);
begin
mAge:=(sysdate-dateOfBirth)/365.25;
return mAge;
end;
SQL> @query.sql
13
14
15 /
Warning: Function created with compilation errors.
当我点击显示错误时,我得到以下信息:
代码:
SQL> show error
Errors for FUNCTION AGE:
LINE/COL ERROR
-------- -----------------------------------------------------------------
5/8 PL/SQL: Item ignored
5/15 PLS-00325: non-integral numeric literal 5.2 is inappropriate in
this context
8/8 PL/SQL: Statement ignored
8/8 PLS-00320: the declaration of the type of this expression is
incomplete or malformed
9/5 PL/SQL: Statement ignored
9/12 PLS-00320: the declaration of the type of this expression is
incomplete or malformed
LINE/COL ERROR
-------- -----------------------------------------------------------------
我尝试从:Oracle 程序中执行以下操作
1) SQL> set role none;
和
2) SELECT ON DBA_TAB_COLUMNS;
但是上面的第二个查询抛出错误:缺少表达式。
请让我知道以上所有内容有什么问题。
谢谢