直接SQLPLUS下: create or replace procedure spdet is begin insert into metac.dim_geo_province (province_id,province) select distinct nrdb.region_city.province_id, nvl(nrdb.region_city.province_name,'未知') from nrdb.region_city where not exists( select dim_geo_province.province_id from metacube.dim_geo_province where nrdb.region_city.province_id= metac.dim_geo_province.province_id ); commit; end; /
我想在系统初始化时调用这个文件,所以直接在sqlplus下行不通把?
这个SQL的执行只是创建了一个过程要 想运行这个过程还需要 写个执行这个过程的命令的
我的os是unix,怎么写执行命令呢!请多指教! to :baojianjun,实际上我有多个存储过程文件的,我不能一个一个的执行,所以用一条命令全部执行,可气的是,在执行过程中他不把sql写入oracle,而执行sql语句,因为nrdb,metac都给定死了,所以就会出错,错误结果是: Execute SQL Error: insert into metac.dim_geo_province (province_id,province) select distinct nrdb.region_city.province_id, nvl(nrdb.region_city.province_name,'未知') from nrdb.region_city where not exists( select dim_geo_province.province_id from metacube.dim_geo_province where nrdb.region_city.province_id= metac.dim_geo_province.province_id );ORA-00942: table or view does not exist (DBD ERROR: error possibly near <*> indicator at char 145 in insert into metac.dim_geo_province (province_id,province) select distinct nrdb.region_city.province_id, nvl(nrdb.region_city.province_name,'未知') from nrdb.region_city where not exists( select dim_geo_province.province_id from metacube.dim_geo_province where nrdb.region_city.province_id= metac.dim_geo_province.province_id )'
再plussql中出现Warning: Procedure created with compilation errors,如何避免呢
create or replace procedure spdet
is
begin
insert into metac.dim_geo_province (province_id,province)
select
distinct nrdb.region_city.province_id,
nvl(nrdb.region_city.province_name,'未知')
from nrdb.region_city
where not exists(
select dim_geo_province.province_id
from metacube.dim_geo_province
where
nrdb.region_city.province_id=
metac.dim_geo_province.province_id
);
commit;
end;
/
to :baojianjun,实际上我有多个存储过程文件的,我不能一个一个的执行,所以用一条命令全部执行,可气的是,在执行过程中他不把sql写入oracle,而执行sql语句,因为nrdb,metac都给定死了,所以就会出错,错误结果是:
Execute SQL Error: insert into metac.dim_geo_province (province_id,province)
select
distinct nrdb.region_city.province_id,
nvl(nrdb.region_city.province_name,'未知')
from nrdb.region_city
where not exists(
select dim_geo_province.province_id
from metacube.dim_geo_province
where
nrdb.region_city.province_id=
metac.dim_geo_province.province_id
);ORA-00942: table or view does not exist (DBD ERROR: error possibly near <*> indicator at char 145 in
insert into metac.dim_geo_province (province_id,province)
select
distinct nrdb.region_city.province_id,
nvl(nrdb.region_city.province_name,'未知')
from nrdb.region_city
where not exists(
select dim_geo_province.province_id
from metacube.dim_geo_province
where
nrdb.region_city.province_id=
metac.dim_geo_province.province_id
)'
加上show error