表结构如下:
create table FB_P_PRJTODIV
(
SET_YEAR NUMBER(4) not null,
DIV_CODE VARCHAR2(36) not null,
PRJ_ID VARCHAR2(20) not null,
RG_CODE VARCHAR2(20),
LAST_VER VARCHAR2(40)
)
create table AA_CC
(
CHR_CODE VARCHAR2(42)
)如何往FB_P_PRJTODIV表循环插入FB_P_PRJTODIV表现有的数据,在插入的时候,div_code要替换成AA_CC的div_code,直到AA_CC表在FB_P_PRJTODIV都有div_code对应的信息。
create table FB_P_PRJTODIV
(
SET_YEAR NUMBER(4) not null,
DIV_CODE VARCHAR2(36) not null,
PRJ_ID VARCHAR2(20) not null,
RG_CODE VARCHAR2(20),
LAST_VER VARCHAR2(40)
)
create table AA_CC
(
CHR_CODE VARCHAR2(42)
)如何往FB_P_PRJTODIV表循环插入FB_P_PRJTODIV表现有的数据,在插入的时候,div_code要替换成AA_CC的div_code,直到AA_CC表在FB_P_PRJTODIV都有div_code对应的信息。
解决方案 »
- oracle exp 远程导出数据报错 EXP-00056: 遇到 ORACLE 错误 12514
- oracle form开发的一个小问题.
- 急!哥们的分全豁出去了只求一oracle命令行建库的方法 在线狂等
- JOB中存储过程有dbms_output.put_line,对该过程的UPDATE,INSERT,DELETE会有影响吗?
- 请问各位oracle的初学者用什么教材好一些,谢谢
- oracle9i 分布式建立步骤有哪些?
- 谢谢大家!
- 10分----请教为何授权不成功
- 从sql-server导出的数据表能否导入oracle中
- 如何把sql7.0中的视图直接导入到oracle8.0.5中?
- 返回结果怎么按in排序
- 请教SQL语句数据库为ORACLE
values (2010, '143010001', '03840001', '440304', '');insert into fb_p_prjtodiv (SET_YEAR, DIV_CODE, PRJ_ID, RG_CODE, LAST_VER)
values (2010, '143010001', '03850001', '440304', '');insert into fb_p_prjtodiv (SET_YEAR, DIV_CODE, PRJ_ID, RG_CODE, LAST_VER)
values (2010, '143010001', '03860001', '440304', '');insert into fb_p_prjtodiv (SET_YEAR, DIV_CODE, PRJ_ID, RG_CODE, LAST_VER)
values (2010, '143010001', '03870001', '440304', '');
insert into aa_cc (CHR_CODE)
values ('147010098');insert into aa_cc (CHR_CODE)
values ('148010098');insert into aa_cc (CHR_CODE)
values ('149010098');insert into aa_cc (CHR_CODE)
values ('146010098');insert into aa_cc (CHR_CODE)
values ('150010098');insert into aa_cc (CHR_CODE)
values ('148010008');insert into aa_cc (CHR_CODE)
values ('148010009');insert into aa_cc (CHR_CODE)
values ('148010010');insert into aa_cc (CHR_CODE)
values ('149010001');insert into aa_cc (CHR_CODE)
values ('149010002');insert into aa_cc (CHR_CODE)
values ('149010003');insert into aa_cc (CHR_CODE)
values ('149010004');insert into aa_cc (CHR_CODE)
values ('149010005');insert into aa_cc (CHR_CODE)
values ('149010006');insert into aa_cc (CHR_CODE)
values ('149010007');insert into aa_cc (CHR_CODE)
values ('149010008');insert into aa_cc (CHR_CODE)
values ('147010008');insert into aa_cc (CHR_CODE)
values ('147010009');insert into aa_cc (CHR_CODE)
values ('147010010');insert into aa_cc (CHR_CODE)
values ('147010011');insert into aa_cc (CHR_CODE)
values ('147010012');insert into aa_cc (CHR_CODE)
values ('147010013');insert into aa_cc (CHR_CODE)
values ('146010010');insert into aa_cc (CHR_CODE)
values ('146010011');insert into aa_cc (CHR_CODE)
values ('146010012');insert into aa_cc (CHR_CODE)
values ('146010013');insert into aa_cc (CHR_CODE)
values ('146010014');insert into aa_cc (CHR_CODE)
values ('146010015');insert into aa_cc (CHR_CODE)
values ('148010001');insert into aa_cc (CHR_CODE)
values ('148010002');insert into aa_cc (CHR_CODE)
values ('148010003');insert into aa_cc (CHR_CODE)
values ('148010004');insert into aa_cc (CHR_CODE)
values ('148010005');insert into aa_cc (CHR_CODE)
values ('148010006');insert into aa_cc (CHR_CODE)
values ('148010007');insert into aa_cc (CHR_CODE)
values ('146010005');insert into aa_cc (CHR_CODE)
values ('146010006');insert into aa_cc (CHR_CODE)
values ('146010007');insert into aa_cc (CHR_CODE)
values ('146010008');insert into aa_cc (CHR_CODE)
values ('146010009');insert into aa_cc (CHR_CODE)
values ('144010098');insert into aa_cc (CHR_CODE)
values ('145010098');insert into aa_cc (CHR_CODE)
values ('151010098');insert into aa_cc (CHR_CODE)
values ('152010098');insert into aa_cc (CHR_CODE)
values ('145010003');insert into aa_cc (CHR_CODE)
values ('146010016');insert into aa_cc (CHR_CODE)
values ('147010001');insert into aa_cc (CHR_CODE)
values ('150010001');insert into aa_cc (CHR_CODE)
values ('150010002');insert into aa_cc (CHR_CODE)
values ('150010003');insert into aa_cc (CHR_CODE)
values ('150010004');insert into aa_cc (CHR_CODE)
values ('150010005');insert into aa_cc (CHR_CODE)
values ('150010006');insert into aa_cc (CHR_CODE)
values ('150010007');insert into aa_cc (CHR_CODE)
values ('150010008');insert into aa_cc (CHR_CODE)
values ('150010009');insert into aa_cc (CHR_CODE)
values ('150010010');insert into aa_cc (CHR_CODE)
values ('150010011');insert into aa_cc (CHR_CODE)
values ('150010012');insert into aa_cc (CHR_CODE)
values ('145010009');insert into aa_cc (CHR_CODE)
values ('145010010');insert into aa_cc (CHR_CODE)
values ('143010098');insert into aa_cc (CHR_CODE)
values ('147010002');insert into aa_cc (CHR_CODE)
values ('147010003');insert into aa_cc (CHR_CODE)
values ('147010004');insert into aa_cc (CHR_CODE)
values ('147010005');insert into aa_cc (CHR_CODE)
values ('147010006');insert into aa_cc (CHR_CODE)
values ('147010007');insert into aa_cc (CHR_CODE)
values ('143010002');insert into aa_cc (CHR_CODE)
values ('144010002');insert into aa_cc (CHR_CODE)
values ('144010003');insert into aa_cc (CHR_CODE)
values ('144010004');insert into aa_cc (CHR_CODE)
values ('144010005');insert into aa_cc (CHR_CODE)
values ('144010006');insert into aa_cc (CHR_CODE)
values ('144010007');insert into aa_cc (CHR_CODE)
values ('144010008');insert into aa_cc (CHR_CODE)
values ('144010009');insert into aa_cc (CHR_CODE)
values ('144010010');insert into aa_cc (CHR_CODE)
values ('144010011');insert into aa_cc (CHR_CODE)
values ('145010001');insert into aa_cc (CHR_CODE)
values ('145010002');insert into aa_cc (CHR_CODE)
values ('145010008');insert into aa_cc (CHR_CODE)
values ('146010001');insert into aa_cc (CHR_CODE)
values ('146010002');insert into aa_cc (CHR_CODE)
values ('146010003');insert into aa_cc (CHR_CODE)
values ('146010004');insert into aa_cc (CHR_CODE)
values ('145010004');insert into aa_cc (CHR_CODE)
values ('145010005');insert into aa_cc (CHR_CODE)
values ('145010006');insert into aa_cc (CHR_CODE)
values ('145010007');insert into aa_cc (CHR_CODE)
values ('143010003');insert into aa_cc (CHR_CODE)
values ('143010004');insert into aa_cc (CHR_CODE)
values ('143010005');insert into aa_cc (CHR_CODE)
values ('143010006');insert into aa_cc (CHR_CODE)
values ('143010007');insert into aa_cc (CHR_CODE)
values ('143010013');insert into aa_cc (CHR_CODE)
values ('143010014');insert into aa_cc (CHR_CODE)
values ('144010001');insert into aa_cc (CHR_CODE)
values ('151010001');insert into aa_cc (CHR_CODE)
values ('151010002');insert into aa_cc (CHR_CODE)
values ('151010003');insert into aa_cc (CHR_CODE)
values ('151010004');insert into aa_cc (CHR_CODE)
values ('151010005');insert into aa_cc (CHR_CODE)
values ('152010001');insert into aa_cc (CHR_CODE)
values ('152010002');insert into aa_cc (CHR_CODE)
values ('143010008');insert into aa_cc (CHR_CODE)
values ('143010009');insert into aa_cc (CHR_CODE)
values ('143010010');insert into aa_cc (CHR_CODE)
values ('143010011');insert into aa_cc (CHR_CODE)
values ('143010012');insert into aa_cc (CHR_CODE)
values ('152010003');insert into aa_cc (CHR_CODE)
values ('152010004');insert into aa_cc (CHR_CODE)
values ('152010005');
for i in (select CHR_CODE from aa_cc) loop
insert into fb_p_prjtodiv select SET_YEAR, i.CHR_CODE, PRJ_ID, RG_CODE, LAST_VER from temp;
end loop;
end;drop table temp;