我編寫了函數,並調用了以下過程。兩種編碼都可以執行,但是當我執行ProdDetails(10010)時,它顯示錯誤。任何人都可以知道有什麼問題嗎?通過過程調用函數的錯誤
create or replace function ProdCheck(
f_product_id in number)
return varchar IS
f_product_name varchar(30);
f_product_price number;
begin
select product_name, price into f_product_name, f_product_price
from product
where product_id = f_product_id;
return f_product_name;
end;
create or replace procedure ProdDetails(
sp_product_id in number
)IS
f_product_id number;
sp_name varchar(30);
sp_price number;
begin
f_product_id := ProdCheck(sp_product_id);
if f_product_id > 0 then
dbms_output.put_line('Product Name : '||sp_name);
dbms_output.put_line('Product Price : '||sp_price);
else
dbms_output.put_line('Product not in the database!');
end if;
end;
也許提及什麼錯誤是? –
http://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-on-so-when-asking-a-question/285557#285557 –