在plsql过程中将对象作为参数传递时编译时错误

时间:2018-03-21 15:03:06

标签: sql oracle plsql

测试将对象作为pl / SQL过程中的参数传递但是得到错误。

CREATE OR REPLACE TYPE address_obj AS OBJECT 
(house_no varchar2(10), 
 street varchar2(30), 
 city varchar2(20), 
 state varchar2(10), 
 pincode varchar2(10) 
) NOT FINAL; 
/


create table billing_address (house_no varchar2(10), 
 street varchar2(30), 
 city varchar2(20), 
 state varchar2(10), 
 pincode varchar2(10) 
);

create procedure save_address   ( pi_address in  address_obj)
is

begin

insert into billing_address values
(pi_address.house_no,pi_address.street,pi_address.city,pi_address.state,pi_address.pincode);
commit;
end save_address;                                                   

获取错误:

  

[错误] PLS-00201(15:1):PLS-00201:标识符' STREET'必须申报,
  [错误] PLS-00201(16:1):PLS-00201:标识符' CITY'必须申报,
  [错误] PLS-00201(17:1):PLS-00201:标识符'状态'必须申报,
  [错误] PLS-00201(18:1):PLS-00201:标识符' PINCODE'必须申报,
  [错误] ORA-00984(20:61):PL / SQL:ORA-00984:此处不允许列

0 个答案:

没有答案