我想编写一个函数,返回给定月份中带来的产品。将月份传递给pl/sql函数?
我想这
create or replace
function myfun(mymonth date)
return date
is
cursor cur
is
select *
from products
where purchase_date=mymonth;
begin
for i in cur
loop
dbms_output.put_line(i.product_id || ', ' ||
i.description || ', ' ||
i.product_name || ', ' ||
i.quantity || ', ' ||
i.price || ', ' ||
i.purchase_date);
end loop;
return 1;
end;
这给我的错误。 我如何将月份传递给pl/sql函数并检索数据。
请给我们提供错误信息 –
什么是yout表结构?你在传什么?你的函数说它返回一个DATE,但你试图返回1这是一个数字。您在这里发布的内容存在很多问题,您需要提供更多信息才能解决问题。 – Ollie