oracle insert怎么实现的
展开全部
return number is
numb number;
begin
select count(*)
into numb
from cp_index_statistics_rec
where stat_date = to_date(to_char(statdate, 'yyyy/mm/dd'), 'yyyy/mm/dd')
and cp_id = cpid
and index_type_code = indextypecode
and index_item_code = indexitemcode;
if numb = 0 then
--数据不存在,insert
begin
insert into cp_index_statistics_rec
(stat_id,
stat_date,
diagnosis,
cp_id,
is_validate,
index_type_code,
index_item_code,
stat_data,
stat_create_date,
cp_name)
numb number;
begin
select count(*)
into numb
from cp_index_statistics_rec
where stat_date = to_date(to_char(statdate, 'yyyy/mm/dd'), 'yyyy/mm/dd')
and cp_id = cpid
and index_type_code = indextypecode
and index_item_code = indexitemcode;
if numb = 0 then
--数据不存在,insert
begin
insert into cp_index_statistics_rec
(stat_id,
stat_date,
diagnosis,
cp_id,
is_validate,
index_type_code,
index_item_code,
stat_data,
stat_create_date,
cp_name)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询