【发布时间】:2019-10-15 01:23:47
【问题描述】:
我有一个简单的测试函数,我在其中传递一个特定的 ID(我从中选择的表的主键),并在其上计算一个简单的函数和参数。
骨架代码及测试:
create or replace function test(id varchar2, area float) return float is
theRow forest%ROWTYPE;
begin
select * into theRow from forest where Forest_No = id;
return area / theRow.Area;
end;
begin
select test('1', 16000) from dual;
end;
输出:
[2019-10-14 21:19:10] [65000][6550] ORA-06550: line 2, column 5:
[2019-10-14 21:19:10] PLS-00428: an INTO clause is expected in this SELECT statement
据我所知,文档和示例使用相同的顺序和语法,我不知道该怎么做。我曾尝试像在 Postgresql 中那样将 into 子句移到末尾,但这没有用。
我在这里错过了什么?
【问题讨论】: