`
ticojj
  • 浏览: 153296 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

drop command in Procedure

 
阅读更多
EXEC pkg_dwh_common_proc.stpr_dwh_drop_tbl('tbl_maprg_pp_usr_main_tmp', 'N');

create table  tbl_maprg_pp_usr_main_tmp 
tablespace &5
as
select * from tbl_maprg_pp_vst_usr_maint_u where 1=2 ;

variable month_cnt   number;

BEGIN

  select count(*) INTO :month_cnt
  from tbl_maprg_pp_vst_usr_maint_u
  where month>to_char(add_months(to_date('&4','yyyymmdd'),-24),'yyyymm')
    and month<to_char(add_months(to_date('&4','yyyymmdd'),+1),'yyyymm')
    and aprov_flg='Y';

  IF :month_cnt!=24 THEN
 
  execute immediate 'drop table tbl_maprg_pp_usr_main_tmp ';
 
  Dbms_Output.put_line('Please check the user maintenance table!');
 
  ELSE 
    Dbms_Output.put_line('OK!');
  END IF;
 
  execute immediate 'select * from tbl_maprg_pp_usr_main_tmp' ;  
  execute immediate 'drop table tbl_maprg_pp_usr_main_tmp ';
 
END;
/
分享到:
评论

相关推荐

    Sakemail

    If you are strongly opossed to this change, drop me a line and tell me why (I‘m in doubts).1.8.5- Greg Nixon added the priority property. The default priority for each msg created will be prNormal, ...

    微软内部资料-SQL性能优化3

    In our example, if one transaction (T1) holds an exclusive lock at the table level, and another transaction (T2) holds an exclusive lock at the row level, each of the transactions believe they have ...

    微软内部资料-SQL性能优化5

    As we’ll see, the clustered key is duplicated in every nonclustered index row, so keeping your clustered key small will allow you to have more index fit per page in all your indexes. Note The ...

    VB编程资源大全(英文源码 其它)

    MessageBoxDll.zip This is a custom message box creator.It provides the following functionalities that are not provided by the MsgBox function in VB.&lt;END&gt;&lt;br&gt;68,DragDrop.zip This is a code that ...

    CalcExpress

    In Kylix: 0) Make sure you do not have any projects open (File-&gt;Close All) 1) Make a directory named CalcExpress as a subdirectory of ~/.borland This can be done either from any file manager or from ...

    Sybase数据库审计介绍[定义].pdf

    * SQL Server级:login、logout、reboot、remote procedure call、fatal error、privileged command * Database级:grant、revoke、truncate table、drop、use * Object级:table/view access、procedure、trigger ...

    ICS delphixe10源码版

    .\Source\Include (was Delphi\Vc32) .inc files (including OverbyteIcsDefs.inc) .\Source\Extras (was Delphi\Vc32) Extra source code not built into packages .\Source\zobj125 (was Delphi\Vc32) ZLIB C OBJ ...

    曲线拟合工具CurveExpert 1.0

    quotes in it. This has been corrected, so it is now easier to read. + The help file was not terminated when CurveExpert was. Fixed. + The Window and Help menus were moved to more conventional ...

    VB编程资源大全(英文源码 控制)

    It also has an example of how to change a label control to a 3D command button.&lt;END&gt;&lt;br&gt;42 , splitpanel2.zip A re-written version of the SplitPanel that David originally put onto this site about a...

    最全的oracle常用命令大全.txt

    SQL&gt;select object_name,status from user_objects where object_type='PROCEDURE'; 查看函数和过程的源代码 SQL&gt;select text from all_source where owner=user and name=upper('&plsql_name'); 三、查看...

    SQL语法大全

    Source参数可以是一个Command对象名称、一段SQL命令、一个指定的数据表名称或是一个Stored Procedure。假如省略这个参数,系统则采用Recordset对象的Source属性。 ActiveConnection Recordset对象可以通过...

Global site tag (gtag.js) - Google Analytics