3
我想创建这样的功能:为什么在尝试创建这个简单功能时收到PLS-00103?
create or replace function g(sN int) return char(3) as
t char(3);
begin
select pt into t from (
select pTT as pt, pC
from ple
order by pC asc
) where sN <= pC and rownum <= 1;
return t;
end;
/
我收到此以下错误:
LINE/COL ERROR
-------- -----------------------------------------------------------------
1/31 PLS-00103: Encountered the symbol "(" when expecting one of the
following:
; is authid as cluster order using external varying character
large deterministic parallel_enable pipelined aggregate
result_cache accessible
2/9 PLS-00103: Encountered the symbol "CHAR" when expecting one of
the following:
, from into bulk
The symbol "," was substituted for "CHAR" to continue.
LINE/COL ERROR
-------- -----------------------------------------------------------------
2/16 PLS-00103: Encountered the symbol ";" when expecting one of the
following:
. (, * % & - +/at mod remainder rem <an identifier>
<a double-quoted delimited-identifier> <an exponent (**)> as
from into || multiset bulk
11/8 PLS-00103: Encountered the symbol "end-of-file" when expecting
one of the following:
end not pragma final instantiable order overriding static
member constructor map
我的问题:
- 在一般情况下,为什么这些错误发生,或者意味着什么?
- 更具体地说,为什么我收到此错误?
我的研究: 在SO上有许多涉及PLS-00103的问题,但它们都不符合我的功能。
,我看到的,使得引起了一些问题PLS-00103是:
- 意外使用的保留字,像最大或最小的,作为变量名。
- 不正确地使用循环结构关键字,例如使用EXIT LOOP结束 循环,而不是END LOOP。
- 将值错误地赋值给变量,如x + 9 = x。
当然,这并不是我列为PLS-00103的问题的全面列表,但我认为我的功能不适用于我所见过的任何一个。
非常感谢。 – TheHumblePedestrian