<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<!--
* 控制反转(IoC = Inversion of Control),依赖注入(DI = Dependency Injection)
*需要关注其他的要点:
* 1.bean的作用域
* 2.bean的生命周期
* 3.继承等的使用
* 4.注解的使用
个人比较的
-->
<!-- 属性注入Setter方式 对象属性-外部bean注入 ref这里不补充-->
<bean id="UserDaoImpl" class="com.albert.spring.base.UserDaoImpl" />
<bean id="User" class="com.albert.spring.base.User">
<property name="id" value="1" />
<property name="userName" value="albert" />
<property name="passWord" value="albert" />
<property name="list">
<list>
<value>List值一</value>
<value>List值二</value>
<value>List值三</value>
</list>
</property>
<property name="set">
<set>
<value>Set值二</value>
<value>Set值一</value>
<value>Set值三</value>
</set>
</property>
<property name="map">
<map>
<entry key="one" value="一" />
<entry key="two" value="二" />
<entry key="three" value="三" />
</map>
</property>
<property name="pro">
<props>
<prop key="p1">first</prop>
<prop key="p2">second</prop>
<prop key="p3">third</prop>
</props>
</property>
</bean>
<!-- 属性注入构造器方式 必须提供默认的构造器 -->
<bean id="UserConstructor" class="com.albert.spring.base.User">
<constructor-arg index="0" value="李某某" />
<constructor-arg index="1" value="test" />
<constructor-arg index="2">
<list>
<value>List值一</value>
<value>List值二</value>
<value>List值三</value>
</list>
</constructor-arg>
</bean>
</beans>
删除分区
CREATE OR REPLACE PROCEDURE "PRO_MESSAGE_DELETE"
is
names varchar2(1024); --分区名称
dates varchar2(1024); --分区日期
temp varchar2(1024);
v_temp varchar2(1024);
v_sql varchar2(1024);
v_cs varchar2(1024);
v_error varchar2(1024);
--获取分区列表
cursor c is
select PARTITION_NAME,HIGH_VALUE
from USER_TAB_PARTITIONS
where TABLE_NAME ='US_INTERNALINFO';
begin
open c ;
fetch c
into names,dates;
while c% found loop
--获得分区时间
v_temp := 'select to_char('||dates||',''yyyy-MM-dd'') from dual';
execute immediate v_temp into temp ;
--时间比较
if (months_between(trunc(sysdate,'mm'),trunc(to_date(temp,'yyyy-mm-dd'),'mm'))>=3)
then
---删除分区
-- v_sql := 'alter table us_internalinfo truncate partition ' ||names;
--查找分区里type=1并删除
v_sql := 'DELETE FROM US_INTERNALINFO partition('||names||') t where t.type=1';
execute immediate v_sql;
--dbms_output.put_line(names);
end if;
--取下一条数据
fetch c into names,dates;
end loop;
close c;
commit;
exception
when others then
v_error := sqlcode || ' - ' || sqlerrm;
dbms_output.put_line(v_error);
rollback;
end PRO_MESSAGE_DELETE;
/
8976

被折叠的 条评论
为什么被折叠?



