`
xinyoulinglei
  • 浏览: 123829 次
社区版块
存档分类
最新评论

oracle利用user_db_like的存储过程

阅读更多
CREATE OR REPLACE PROCEDURE hello
as
  --定义参数
  --得到objectid
  cursor Cursor_Objectid is
   select id  from (select a1.id from resource_wap_data_finish a1 union select b1.id from resource_client_data_finish b1);
  
  --定义接收游标中的数据变量
  v_objectid resource_wap_data_finish.id%type;

Begin

  --删除表数据
  --打开游标
  open Cursor_Objectid;
  --取游标中的数据
  loop
   -- v_countDelobjID := v_countDelobjID + 1;
    --遍历游标中的下一行数据
    fetch Cursor_Objectid
      into v_objectid;
    --检测是否已经达到最后一行
    exit when Cursor_Objectid%notfound;
    --删除数据信息
    
     EXECUTE IMMEDIATE 'insert into  t_iiss_c_resoperationlog@LINK_BFMDB(gid,rescode,opttype)values(SEQ_IISS_UNION.NEXTVAL@LINK_BFMDB,'||v_objectid||',5) ';
  end loop;
  close Cursor_Objectid;
  --执行完游标
  commit;
  --提交异常 信息
    exception
    when others then
   DBMS_OUTPUT.PUT_LINE('sssssssssssssssssssssssssssssssssss'); 

         rollback ;
end hello;
分享到:
评论

相关推荐

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

    su - oracle -c "exp system/manager full=y inctype=complete file=/oracle/export/db_comp$rq.dmp" 累计备份的SH文件:exp_cumu.sh rq=` date +"%m%d" ` su - oracle -c "exp system/manager full=y inctype=...

    Oracle事例

    sql> create user juncky identified by oracle default tablespace users sql> temporary tablespace temp quota 10m on data password expire sql> [account lock|unlock] [profile profilename|default]; ...

    oracle 语句

    @d:D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utlxplan.sql—创建了索引查询表 explain plan for select ename,job,sal,comm from empcon where (sal-700);--已解释 desc plan_table; col id for 999 col ...

    orcale常用命令

    8、存储函数和过程 查看函数和过程的状态 SQL>select object_name,status from user_objects where object_type='FUNCTION'; SQL>select object_name,status from user_objects where object_type='PROCEDURE';...

    利用 Oracle 和 PHP 管理分布式跟踪文件

    Ensure that the directories specified in the parameters for USER_DUMP_DEST and BACKGROUND_DUMP_DEST are set up as utl_file_dir directives in the init.ora, eg utl_file_dir=myDB/oratrace/back utl_file_...

    oracle学习文档 笔记 全面 深刻 详细 通俗易懂 doc word格式 清晰 连接字符串

     删除HKEY_CURRENT_USER/SOFTWARE/Microsoft/windows/CurrentVersion/Explorer/MenuOrder/Start Menu/Programs中所有以oracle 开头的键。  删除HKDY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBCINST.INI中除Microsoft ...

    ora分析脚本

    Usage: ora [-u user] [-i instance#] <command> [] General -u user/pass use USER/PASS to log in -i instance# append # to ORACLE_SID -sid <sid> set ORACLE_SID to sid -top # limit some large queries ...

    php.ini-development

    user_ini.filename = ".user.ini" ; To disable this feature set this option to empty value ;user_ini.filename = ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds ...

    2009达内SQL学习笔记

    如:select table_name from user_tables where table_name like 'S\_%' escape'\'; ' 找出“S_“开头的,由于下划线有任意字符的含义,故需另外定义转移符。 但习惯用“\”,为方便其他程序员阅读和检测,一般不...

    精通SQL数据库连接.doc

    WHERE coname LIKE ‘%Tech%’ AND indname = ‘Computing’; 注意AS关键字是任选的,然而我建议使用他从而更加清楚。而且,专栏可以使用格式alias = table_name.column_name来别名化,但表格不能这样来别名化。 自...

    PLSQL.Developer(X32) v12.0.1.1814主程序+ v11中文包+keygen

    The filename can include %dbname%, %dbuser% and %date% variables to separate output files based on the database, user and date. Program Window Enhancements You can now suppress a hint or warning for...

    PLSQL.Developer(X64) v12.0.1.1814 主程序+ v11中文包+keygen

    The filename can include %dbname%, %dbuser% and %date% variables to separate output files based on the database, user and date. Program Window Enhancements You can now suppress a hint or warning for...

    plsqldev12.0.4.1826x64主程序+ v12中文包+keygen

    The filename can include %dbname%, %dbuser% and %date% variables to separate output files based on the database, user and date. Program Window Enhancements You can now suppress a hint or warning for ...

    plsqldev12.0.4.1826x32主程序+ v12中文包+keygen

    The filename can include %dbname%, %dbuser% and %date% variables to separate output files based on the database, user and date. Program Window Enhancements You can now suppress a hint or warning for ...

    Absolute Database for D7

    no DLLs Single-file database SQL‘92 (DDL & DML) support Single-user and multi-user mode (file-server) Unmatched ease-of-use 100% compatibility with standard DB-aware controls Strong encryption BLOB ...

    经典SQL语句大全

    查找:select * from table1 where field1 like ’%value1%’ ---like的语法很精妙,查资料! 排序:select * from table1 order by field1,field2 [desc] 总数:select count as totalcount from table1 求和:...

    数据库操作语句大全(sql)

    查找:select * from table1 where field1 like ’%value1%’ ---like的语法很精妙,查资料! 排序:select * from table1 order by field1,field2 [desc] 总数:select count as totalcount from table1 求和:...

    sql经典语句一部分

    查找:select * from table1 where field1 like ’%value1%’ ---like的语法很精妙,查资料! 排序:select * from table1 order by field1,field2 [desc] 总数:select count as totalcount from table1 求和:...

    xls转mdb代码以及.exe执行软件

    实现数据导入/导出的存储过程 根据不同的参数,可以实现导入/导出整个数据库/单个表 调用示例: --导出调用示例 ----导出单个表 exec file2table 'zj','','','xzkh_sa..地区资料','c:\zj.txt',1 ----导出整个数据库 ...

    mysql基础只是总结

    mssql 2000 Access DB2 oracle 【mysql安装】 1、官方下载mysql win32 msi 2、点击安装 3、配置 4、查看是否安装成功 通过cmd 输入netstat -a搜索3306端口是否处于listening状态 【mysql服务的启动与停止】 1...

Global site tag (gtag.js) - Google Analytics