使用正确的语法,将如下所示:

create or replace procedure daily_rpt

( v_start in date

, v_end in date )

as

begin

for r in (

select ao_out_no, 0 as exists_check

from tablea

)

loop

select count(*) into exists_check

from tablea

where out_no = r.ao_out_no

and rownum = 1;

if r.exists_check > 0 then

--DO NOTHING

else

insert into tableb (out_no) values (r.ao_out_no);

end if;

end loop;

end;

但是,查询所有行然后对每行进行一次额外的查找来确定是否要使用它是低效率的,因为SQL可以为您做这种事情。 因此版本2可能类似于:

create or replace procedure daily_rpt

( v_start in date

, v_end in date )

as

begin

for r in (

select ao_out_no

from tablea

where not exists

( select count(*)

from tablea

where out_no = r.ao_out_no

and rownum = 1 )

)

loop

insert into tableb (out_no) values (r.ao_out_no);

end loop;

end;

在这一点上,您可以将整个循环替换为insert ... where not exists (...)语句。

oracle 报错pls 00405,oracle - 检查是否存在PLS-00405:在此上下文中不允许子查询 - 堆栈内存溢出...相关推荐

  1. Linux/Centos 安装oracle报错“调用makefile '/oracle/produc

    解决centos7/redhat7安装oracle11g到%70报错问题 Linux/Centos 安装oracle报错"调用makefile '/oracle/product/11.2.0 ...

  2. python连接oracle报错tns_Python3操作oracle数据库及遇到的报错

    首先下载及安装cx_Oracle: 下载地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/ 安装:pip3.6 install E:\Python36\Scri ...

  3. oracle 12514 pl sql,plsql登陆oracle报错!连接Oracle 10g时ORA-12514: TNS: 监听进程不能解析在连接描述符中给出的...

    plsql登陆oracle出错!连接Oracle 10g时ORA-12514: TNS: 监听进程不能解析在连接描述符中给出的. 我添加了 (SID_DESC =  (GLOBAL_DBNAME =  ...

  4. oracle报错信息乱码,Oracle乱码的问题

    1.sql脚本直接能执行但是以sql文件不能执行 sql正常,由txt转换为sql文件后,数据库执行报错,解决办法是将sql文件中数据取出放到新文件中,新文件保存时直接以sql格式保存. 2.乱码问题 ...

  5. oracle 报错ins 32008,oracle升级报错ins—32027

    匿名用户 1级 2015-12-18 回答 [WARNING] [INS-32008] Oracle base location cant be same as the user home direc ...

  6. oracle报错数据复数,Oracle数据库设计策略及规范

    Oracle数据库设计策略及规范 设计策略及规范 1. 目的 定义Oracle数据库设计规范,作为数据库规划.设计.开发以及维护人员的技术参考资料.用以规范和指导相关人员的设计行为. 2. 概述 本文 ...

  7. ssis连接oracle报错,SSIS 连接Oracle报错 These components are supplied by Oracle

    早上有个朋友发邮件给遇到一个SSIS连接Oracle的问题,具体的错误信息如下: Test connection failed because of an error in initializing ...

  8. centos安装oracle报错,CentOS安装oracle和rsh服务报错处理

    CentOS安装rsh服务rpm包时报错 CentOS安装rsh-0.17-14.i386.rpm和rsh-server-0.17-14.i386.rpm服务包时报错如下:warning: rsh-s ...

  9. 为什么链接oracle报错,PG连接Oracle报错解决

    epoll_wait(3, [{EPOLLIN, {u32=41936840, u64=41936840}}], 1, -1) = 1 recvfrom(10, "Q\0\0\0\26sel ...

最新文章

  1. 在请求分页虚存管理系统中_请求分页式系统中,以页为单位管理用户的虚空间,以段为单位管理内存空间_学小易找答案...
  2. R语言ggplot2可视化:使用scale_shape_identity函数显示pch点形状、使用geom_text函数为pch形状添加标(plot characters)
  3. python matplot 绘图
  4. Java程序(类的抽象与封装)
  5. AI英特尔杯公开课:2019.06.27在线直播《研究生人工智能创新大赛—AI赋能,创新引领》课堂笔记和感悟(一)
  6. edittext禁止换行符但能自动换行简书_使用n-gram创建自动完成系统
  7. php中的var_dump()方法的详细说明
  8. PrimerCH4:表达式
  9. android签名文件查看工具,ionic 发布android,并查看签名文件。
  10. PostgreSQL 12系统表(6)pg_namespace
  11. win10安装账户卡住_win10安装卡着不动怎么处理 解决win10安装卡死方法
  12. linux/unix下telnet提示Escape character is '^]'的意义
  13. Killing Parallel Query Session
  14. 苹果mac科学计算器:PCalc
  15. H5案例分析和场景应用
  16. 串口485接法图_rs485 与485通讯 接线方法?
  17. 如何进行大数据入门的学习
  18. 通过mac地址查找ip
  19. Python tkinter 设置主题
  20. MPB:中大魏泓组-​​无菌小鼠肠道粪菌移植(视频)

热门文章

  1. 科罗拉多州立大学计算机科学专业,美国科罗拉多州立大学有哪些好专业?
  2. linux mysql 5.7 配置_linux下mysql5.7的安装配置
  3. python mysql connector update_Python(Mysql Connector)如何刷新curs上的结果
  4. php aapt apk 包名,aapt 命令可应用于查看apk包名、主activity、版本等很多信息
  5. 如何启用用计算机iis,win7系统如何开启iis功能?电脑iis功能启用图文步骤教程...
  6. C++ >>和<<读写文本文件
  7. kali安装步骤失败 选择并安装软件_Pycharm2019.3.3软件安装步骤
  8. ajax spring mvc 接收json数据,easyui ajax请求获取SpringMVC @ResponseBody返回的Json数据为什么非得eval才能通过对象获取值?...
  9. php ldap 创建用户,PHP LDAP获取作为组成员的成员的用户详细信息
  10. python怎么自动生成测试报告_python生成接口自动化测试报告模版