如何实现取filter_code中的值全部满足的时候,返回成功,失败的时候把所有条件插入一个新表的字段中,并且失败的时候要遍历一遍所有条件,找出那个条件不满足
成功时必须满足如下条件:
'case when user_status_id=1
and x_cust_count=1
and call_duration_nofree>10
and arrear_all_fee and (z_call_count>1 or bill_cust_count_last=1) and user_status_id=1
and x_cust_count=1 and arrear_all_fee and (z_call_count>1 or bill_cust_count_last=1) then '0' else '1' end
求解决方法
mysql:
create procedure p_drop_table_if_exist_v2(p_table_name varchar(20))
begin
declare v_table_name varchar(20);
declare exit handler for not found begin end;
select distinct table_name into v_table_name from information_schema.columns WHERE table_name = p_table_name;
if length(v_table_name)>0 then
set @sql=concat('drop table ', p_table_name);
prepare dtb from @sql;
execute dtb;
deallocate prepare dtb;
end if;
end;
//
oracle:
procedure p_drop_table_if_exist_v2(p_table_name in varchar2)
is
v_table_name varchar2(20);
begin
select table_name into v_table_name from user_tables where table_name=upper(p_table_name);
if length(v_table_name)>0 then
execute immediate 'drop table ' || p_table_name || ' purge';
end if;
exception
when no_data_found then
begin
null;
end;