create or replace procedure manager(v_isbn in varchar2) as v_title varchar2(10); v_retail number; begin update books set retail= retail*decode(upper(category),'COMPUTER',1.2,'COOKING',1.15,'LITERATURE',1.1,'SELF HELP',1.1,1.05) WHERE isbn=v_isbn; select title,retail into v_title,v_retail from books where isbn=v_isbn; dbms_output.put_line('书名:'||v_title||' '||'价格:'||v_retail); end; /
感谢bzszp(SongZip) ,如果我的代码如下: create or replace procedure manager(v_isbn in varchar2,v_title out varchar2 ,v_retail out number ) as begin update books set retail= retail*decode(upper(category),'COMPUTER',1.2,'COOKING',1.15,'LITERATURE',1.1,'SELF HELP',1.1,1.05) WHERE isbn=v_isbn; select title,retail into v_title,v_retail from books where isbn=v_isbn; dbms_output.put_line('title:'||v_title||' '||'retail'||v_retail); end; 该如何调用它??
警告: 创建的过程带有编译错误
v_title varchar2(10);
v_retail number;
begin
update books
set retail= retail*decode(upper(category),'COMPUTER',1.2,'COOKING',1.15,'LITERATURE',1.1,'SELF HELP',1.1,1.05)
WHERE isbn=v_isbn;
select title,retail into v_title,v_retail from books where isbn=v_isbn;
dbms_output.put_line('书名:'||v_title||' '||'价格:'||v_retail);
end;
/
create or replace procedure manager(v_isbn in varchar2,v_title out varchar2 ,v_retail out number ) as
begin
update books
set retail= retail*decode(upper(category),'COMPUTER',1.2,'COOKING',1.15,'LITERATURE',1.1,'SELF HELP',1.1,1.05)
WHERE isbn=v_isbn;
select title,retail into v_title,v_retail from books where isbn=v_isbn;
dbms_output.put_line('title:'||v_title||' '||'retail'||v_retail);
end;
该如何调用它??
visbn varchar2(20):='...';
vtitle varchar2(20);
vretail number;
begin
manager(visbn,vtitle,vretail);
dbms_output.put_line(vtitle||';'||vretail);
end;
/