create or replace procedure pro_temp_customer as
cursor c is select * from TEMP_CRM_CUSTOMER;
begin
for rc in c loop
是想在这个temp_crm_customer中为主键加一个序列每次执行完存贮过程想用truncate table temp_crm_customer清除表内容,之后每天都会往表中新增内容,这样这个主键就部能重复,我自己建立了一个序列不知道怎么在这里使用呢求解答 if rc.point = 'U' then
update crm_customer a set a.city='',a.area='',a.district=''
where a.bankcard in (select temp_crm_customer.bankcard from crm_customer,temp_crm_customer
where crm_customer.address != temp_crm_customer.address and temp_crm_customer.point = 'U' and
temp_crm_customer.bankcard = crm_customer.bankcard);
end if;
end loop;
end;
cursor c is select * from TEMP_CRM_CUSTOMER;
begin
for rc in c loop
是想在这个temp_crm_customer中为主键加一个序列每次执行完存贮过程想用truncate table temp_crm_customer清除表内容,之后每天都会往表中新增内容,这样这个主键就部能重复,我自己建立了一个序列不知道怎么在这里使用呢求解答 if rc.point = 'U' then
update crm_customer a set a.city='',a.area='',a.district=''
where a.bankcard in (select temp_crm_customer.bankcard from crm_customer,temp_crm_customer
where crm_customer.address != temp_crm_customer.address and temp_crm_customer.point = 'U' and
temp_crm_customer.bankcard = crm_customer.bankcard);
end if;
end loop;
end;
解决方案 »
- 我的PL/SQL第一次执行语句都会出现“动态执行表不可访问,本会话的自动统计被禁止。在执行菜单里你可以禁止统计,或在v$session,v$sesstat和v$statname表获得选择权限”
- 关于C#。NET的成绩名次问题???急...请各位帮忙..............
- 816中JOB为何突然失效?
- 求多行记录转换为一条记录sql。
- 同样的查询语句在SQLserver下是好用的,可是在oracle下执行出错,望解答
- 又一个很菜的问题!
- 在线等待:SQL下的CASE..END语句在ORACLE8.05下怎么实现
- 备份数据库时出错?
- 有没有关于如何使用的电子书籍或文章?
- 求助!MS SQL Server 转换到 Oracle 语法!!!
- oracle表备份问题
- 增加控制文件出错
create or replace procedure pro_temp_customer as
cursor c is select * from TEMP_CRM_CUSTOMER;
begin
for rc in c loop
--是想在这个temp_crm_customer中为主键加一个序列每次执行完存贮过程想用
--truncate table temp_crm_customer清除表内容,之后每天都会往表中新增内容,
--这样这个主键就部能重复,我自己建立了一个序列不知道怎么在这里使用呢求解答--1、主键用序列产生,要想truncate table之后重复使用序列,
--那么你truncate table 之后再重新drop sequence ,再创建一次,下次就是用1开始的了啊
if rc.point = 'U' then
update crm_customer a set a.city='',a.area='',a.district=''
where a.bankcard in (select temp_crm_customer.bankcard from crm_customer,temp_crm_customer
where crm_customer.address != temp_crm_customer.address and temp_crm_customer.point = 'U' and
temp_crm_customer.bankcard = crm_customer.bankcard);
end if;
end loop;
--truncate table
execute immediate 'truncate table TEMP_CRM_CUSTOMER';
--drop sequence
execute immediate 'drop sequence sequence_name';
--rebuild sequence
execute immediate 'create or replace sequence sequence_name start with 1 incement by 1';
end;
commitcreate or replace procedure pro_temp_customer as
cursor c is select * from TEMP_CRM_CUSTOMER;
begin
for rc in c loop
if rc.point = 'U' then
update crm_customer a set a.city='',a.area='',a.district=''
where a.bankcard in (select temp_crm_customer.bankcard from crm_customer,temp_crm_customer
where crm_customer.address != temp_crm_customer.address and temp_crm_customer.point = 'U' and
temp_crm_customer.bankcard = crm_customer.bankcard);
end if;
end loop;
execute immediate 'truncate table TEMP_CRM_CUSTOMER';
end;