plsql批量导出procedure脚本

plsql批量导出procedure脚本 

 

plsql批量导出procedure脚本 

方法1.

PL/SQL Developer    menu: Tools -> Export User Objects + File per object / spec & body in a single file

 

 

方法2.Utl_File

 

create or replace directory BCCCGC as 'C:\log';

 

DECLARE

 File_Handle Utl_File.File_Type;

  Stor_Text   Varchar2(4000);

  n           Number;

  i           Number;

Begin

 

 

  For a In (Select object_Name As Name From User_Objects where Object_type= Upper('procedure') AND object_Name LIKE '%EBCAR%' ) Loop

 File_Handle := UTL_FILE.FOPEN('BCCCGC', a.name || '.txt', 'W');

 Select Max(Line) Into n From All_Source Where Owner = Upper( 'cb' ) And Name = a.name;

  While i <= n Loop

    Select Text Into Stor_Text From All_Source Where Owner = Upper( 'cb' ) And Name = a.name And Line = i;

    i := i + 1;

  Utl_File.Put_Line(File_Handle, Stor_Text);

  End Loop;

i := 1;

  Utl_File.Fclose(File_Handle);

 

  Commit;

  End Loop ;

END;

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值