`
ticojj
  • 浏览: 158658 次
  • 性别: 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;
/
分享到:
评论

相关推荐

    db2-sql-command.rar_sql command

    本资源“db2-sql-command.rar”包含了一份关于DB2 SQL基本命令的文档,旨在帮助用户进行数据查询、操作和管理。 一、SQL命令概述 SQL命令大致分为四大类:数据查询语言(DQL)、数据操作语言(DML)、数据定义语言...

    第八章课后习题1

    10. 在Command Line Client模式中,使用`DROP PROCEDURE`或`DROP FUNCTION`语句可以实现对MySQL中定义的存储过程和函数进行删除。 二、选择题 1. 正确答案:C. 对存储过程的修改相当于先删除原有存储过程,然后再...

    DB2存储过程语法大全

    db2 drop procedure proc1 ``` 成功执行以上步骤表明SQL存储过程环境配置正确。 #### SQL Procedure基础原理 存储过程的基础结构主要包括以下组件: - **SQL文件**:存储过程的主要逻辑。 - **嵌入式C程序**:...

    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语句使用技巧大全

    DROP PROCEDURE procedure_name; ``` ##### CREATE TRIGGER - **功能**:创建触发器。 - **标准格式**: ```sql CREATE TRIGGER trigger_name AFTER/BEFORE INSERT/UPDATE/DELETE ON table_name FOR EACH ...

    微软内部资料-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 ...

    mysql数据库学习总结.pdf

    - **删除存储过程**:`DROP PROCEDURE IF EXISTS &lt;procedure_name&gt;;`删除已存在的存储过程。 - **DECLARE语句**:在存储过程中声明变量。 - **存储过程举例**:通常包含条件判断、循环、输入/输出参数等复杂逻辑...

    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 ...

    asp+sql教程

    - **DROP PROCEDURE**:从数据库中删除存储过程。例如: ```sql DROP PROCEDURE proc_name; ``` - **CREATE TRIGGER**:创建一个触发器。例如: ```sql CREATE TRIGGER trigger_name ON table_name AFTER ...

    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 ...

    VB6删除和修改存储过程

    要删除存储过程,我们可以使用`DROP PROCEDURE` SQL语句。在VB6中,通过Command对象的`Execute`方法执行此命令。假设存储过程名为`spDeleteProcedure`,可以这样编写: ```vb cmd.CommandText = "DROP PROCEDURE ...

    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 ...

    数据库审计 ( Sybsecurity数据库 实例演示(sql 2008))PPT

    SQL Server 级包括 login、logout、reboot、remote procedure call、fatal error、privileged command 等操作。Database 级包括 grant、revoke、truncate table、drop、use 等操作。Object 级包括 table/view access...

    曲线拟合工具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 ...

    使用PLSQL_Developer导出Oracle表及数据

    在弹出的对话框中,可以选择要导出的对象类型,如表(Table)、视图(View)、存储过程(Procedure)等。为了将这些对象导出到一个文件中,确保选中“Single file”单选按钮,并指定导出文件的路径和文件名,默认为.sql...

    一个C#存储过程例子

    command.CommandText = "DROP PROCEDURE GetUsers"; command.ExecuteNonQuery(); } } } ``` 在这个例子中,我们首先创建了一个名为"GetUsers"的存储过程,它接受一个用户ID作为参数并返回对应用户的详细信息。...

    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'); 三、查看...

Global site tag (gtag.js) - Google Analytics