oracle 存储过程出错,高手修改

create or replace procedure ACCESS_PROD is
begin
execute immediate 'truncate table access_prod_inst';
select
a.PROD_INST_ID,
a.PRODUCT_ID,
a.ACC_NBR,
a.OWNER_CUST_ID,
a.USE_CUST_ID,
a.ADDRESS_DESC,
a.PRODUCT_PROP,
a.PAYMENT_MODE_CD,
a.CREATE_DATE,
a.FINISH_TIME,
a.COL1,
a.COL4,
a.COL8,
a.COL6,
a.COL10,
a.COMMON_REGION_ID,
a.COMP_INST_ID,
a.COMMENTS,
a.COMM_COL1,
a.COMM_COL2,
a.CHANNEL_ID
into access_prod_inst

from
access_prod_inst@crmbm a where a.lan_id='937'and a.state_cd='001';

execute immediate 'create index access_prod_inst on access_prod_inst (prod_inst_id,acc_nbr)';
commit;
end ACCESS_PROD;

1个回答

create or replace procedure ACCESS_PROD is
v_access_prod_inst access_prod_inst%rowtype;
begin
execute immediate 'truncate table access_prod_inst';
select
a.PROD_INST_ID,
a.PRODUCT_ID,
a.ACC_NBR,
a.OWNER_CUST_ID,
a.USE_CUST_ID,
a.ADDRESS_DESC,
a.PRODUCT_PROP,
a.PAYMENT_MODE_CD,
a.CREATE_DATE,
a.FINISH_TIME,
a.COL1,
a.COL4,
a.COL8,
a.COL6,
a.COL10,
a.COMMON_REGION_ID,
a.COMP_INST_ID,
a.COMMENTS,
a.COMM_COL1,
a.COMM_COL2,
a.CHANNEL_ID
into v_access_prod_inst

from
access_prod_inst@crmbm a where a.lan_id='937'and a.state_cd='001';

--execute immediate 'create index access_prod_inst on access_prod_inst (prod_inst_id,acc_nbr)';
commit;
end ACCESS_PROD;
创建index不能先弄好吗,难道每次都create index?

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问