Article From:https://www.cnblogs.com/niwotaxuexiba/p/9971976.html
--Creation and invocation of stored procedures with parameters
create or replace procedure pro_owners_add1
(
  v_name varchar2,--Name
  v_addressid number,--Address number
  v_housenumber varchar2,--House number
  v_watermeter varchar2,--Water Meter
  v_ownertypeid number,--Owner type
  v_id out number
)
is
begin
  select seq_owners.nextval into v_id from dual;
  insert into t_owners
  values(v_id,v_name,v_addressid,v_housenumber,v_watermeter,sysdate,v_ownertypeid);
  commit;
end;
--Calling stored procedures for outgoing parameters
declare
  v_id number;
begin
  pro_owners_add1('Li Si',2,'32-98','56893214',1,v_id);
  dbms_output.put_line(v_id);
end;

 

Leave a Reply

Your email address will not be published. Required fields are marked *