-3
有人可以告诉我为什么这个PSQL出现编译错误吗?Oracle - PSQL编译错误
set serveroutput on
Create or replace function get_warehouse_location(Name in Customer.Name%type)
return w.location %type as
wLocation warehouse.Location %type;
begin
select warehouse.location
into wLocation
from Customer c, Warehouse w
where cName= 'Finch'
and warehouse.address=' ';
return (Location);
end;
什么是语法错误?第一次脸红,你正在返回'location',它不是你在任何地方定义的变量 - 也许你的意思是'返回wLocation'。一旦你解决了这个问题,我强烈希望你会得到一个运行时错误,因为你的'SELECT'返回的行太多。您正在'客户'和'仓库'表之间进行笛卡尔连接,因此不太可能返回恰好为1的行。 –