---
title: "oracle存储过程"
author: "memorymyann"
date: "2011-02-15T16:48:17Z"
tags: []
categories: ["数据库"]
slug: "oracle"
draft: false
lastmod: "2011-02-15T16:48:17Z"
id: 907033
url: "https://memorymyann.iteye.com/blog/907033"
---

一个简单的存储过程样例，为免忘记，写在这里：

create or replace procedure clean\_userunsubscription(day\_p in number) as  
day\_v number(2);  
last\_v date;  
begin  
    day\_v := day\_p;  
    last\_v := sysdate - day\_p;  
    delete from tbl\_ss\_user\_unsubscription where endtime &lt; last\_v;  
    commit;  
exception  
    when others then  
    rollback;         
end;  
/