CLEANPIPE

说明

此函数用于清空管道

语法

cleanpipe ::=

参数

pipename

管道的名称

返回值

清空成功返回0,清空失败报错。

注解

清空管道时参数传入NULL或者未创建的管道名称会报错。

除创建者和管理员其他用户没有清空私有管道权限。

CLEANPIPE函数提供对DBMS.PURGE方法的实现,该方法的详细说明请参照 PURGE 章节。

示例

-- 清理环境
drop procedure mycleanpipe cascade;
select removepipe('mypipe');
REMOVEPIPE(int)      |
---------------------
0                    |
总数目:1

-- 清空管道内容程序
create procedure mycleanpipe() is
declare
    flag1 int;
    flag2 int;
begin
    flag1 := createpipe('mypipe', 8192, false);
    if flag1 = 0 then
        flag2 := cleanpipe('mypipe');
        if flag2 = 0 then
            dbms_output.put_line('pipe clean success');
        else
            dbms_output.put_line('pipe clean fail');
        end if;
    else
        dbms_output.put_line('pipe create fail');
    end if;
end;

/

exec mycleanpipe();


select removepipe('mypipe');
REMOVEPIPE(int)      |
---------------------
0                    |
总数目:1

drop procedure mycleanpipe;