• 网络学院
  • IT资讯
  • 操作系统
  • 网络技术
  • 软件应用
  • 办公软件
  • 编程技术
  • 网站架设
  • 数据库类
  • 平面设计
  • 多媒体类
  • 游戏资讯
  • 教学论文
  • 认证考试
开发技术:关于变量、移动以及含义
  站点:
  • 首 页
  • 最新软件
  • 文章教程
  • 国内软件
  • 国外软件
  • 绿色软件
  • 源码下载
  • 字体下载
开发技术:关于变量、移动以及含义
软件发布 开发技术:关于变量、移动以及含义
网络软件 系统工具 应用软件 联络聊天 图形图像 多媒体类 行业软件 游戏娱乐 编程开发 安全相关 教育教学 数码软件 绿软下载
热门软件: QQ 瑞星 pplive e话通 木马克星 千千静听 office2000 五笔字根 Photoshop 视频分割
返回文章教程首页 >> 文章首页 >> 认证考试 >> Oracle认证 >> Oracle指导 >> 开发技术:关于变量、移动以及含义

开发技术:关于变量、移动以及含义

添加时间: 2008-4-26 1:21:21  作者: Oracle指导  阅读次数:15   来源: http://www.d9soft.com

        Lines 9-11. Copy the contents of the jokes table into the cache, using the BULK COLLECT query syntax (the most efficient way to retrieve multiple rows of data into a PL/SQL program). Note that I am retrieving all the rows in the jokes table. I do not use the LIMIT clause to fetch a subset of the result set's rows, because I have already established that I have sufficient memory to create the larger cache. As you explore places to apply this caching technique in your applications, you should strongly consider using the FETCH...BULK COLLECT...LIMIT syntax, so that you can control the size of your PGA memory.

Lines 13-20. Use the FIRST and NEXT built-in collection methods to iterate through the collection (result set) from the first row to the last.

Lines 22-29. Use the LAST and PRIOR methods to go in reverse, from the last row to the first.

Lines 31-38. Compare values in different rows by referencing the index value of the rows in which you are interested.

Meaningful or Cuddly?

What are your thoughts about how much information should be displayed to application users when an exception occurs? Say a record can't be created because of a primary key constraint—should users see the "ORA-00001...," so they can give a meaningful message to Support to help track the problem down, or should all that stuff be hidden, so the user gets a more "cuddly" message, maybe with an error log number pointing to a record in an error log table?

My feeling is that when an error occurs, you should provide a message to the user that doesn't violate your company's security protocols, is meaningful, and does not intimidate, in that order of priority.

First, let's address the issue of security. When an error occurs in your application or underlying database that you can anticipate and for which you can write explicit handler logic, you can both control the message and tailor it to user needs and the application's business model.

If, on the other hand, that error is unexpected, it is quite difficult to know a priori (that is, when you are writing generic error-handling and -reporting code) how much information should be shown. What if the error is caused by a malicious user who is attempting to hack into your Web-based application that makes heavy use of dynamic SQL? You don't really want to give any information about the state of the database, such as


ORA-1653 unable to extend table
secure_app.personal_info in tablespace sensitive_data....

And you don't want to display "bad" SQL statements—statements made bad by SQL injection attempts. You could easily reveal enormous amounts of sensitive information.

So for exceptions that are not handled in the PL/SQL code—errors that cannot be anticipated as you write your programs—it is best to keep feedback to an absolute minimum, probably something along these lines:


An unexpected error has occurred. Please contact Support and mention the problem identifier 12345.

Legitimate users will follow up; malicious hackers will look for softer targets.


Let's now address a situation in which your code has handled an error that was anticipated and likely caused by user input. Simply displaying the Oracle error message or, worse, allowing the exception to go unhandled, resulting in a display of the error stack, will not do. So, yes, you should "translate" the generic ORA-0001 or ORA-1403 information and the like into more-cuddly communications that achieve the following objectives: Next Steps

READ more about
LOG ERRORS
Oracle Database Data Warehousing Guide
Oracle Database PL/SQL Packages and Types Reference

BULK COLLECT, FORALL, and SAVE EXCEPTIONS
 


Notify the user that an error has occurred. You surely do not want to "swallow" errors.


The error message should explain the problem in terms the user can understand. From a security standpoint, you should not display the Oracle error code or message. Instead, display a message that explains in application-specific terms what has happened. This usually entails providing context-specific values, such as the name of the column that was being set to NULL or was involved in the duplicate index error.


Where appropriate, tell the user what to do to address the problem (if a "retry" makes sense). You might say, "Change the name of the account to a value that is not currently being used in the database" or "Adjust the birthday of the employee so that the employee is at least 18 years old."


Give the user all the information needed to help the application-support team investigate and resolve the problem. The Oracle exception has only two attributes: error code and error message. Usually, when an error occurs in an application, there are lots of different pieces of data that both contributed to the error's occurrence and can explain the current execution context. If that information is not extracted and saved at the time of the exception, it will be much harder to fix the problem.

开发技术:关于变量、移动以及含义(4) 第 [1] [2] [3] [4] [5]  下一页

 

上下文章:

 

上一篇文章: 入门基础:连接常见错误及解决方法 下一篇文章: 开发技术:调查您的应用程序需求

相关文章:

  • 教你如何用零框架技术加密网页
  • 用端口碰撞技术实现服务器远程管理
  • 城域网光缆线路设计与技术应用
  • Oracle中关于逻辑备份与恢复
  • Oracle开发人员JAVA存储过程

相关软件:

  • 围棋死活习题集移动版之PocketPC 2003版 1.0
  • 围棋死活习题集移动版之Palm版 1.0
  • 围棋死活习题集移动版之Symbian(S90)版 1.00
  • 围棋死活习题集移动版之PocketPC (ARM)版 1.00
  • 围棋死活习题集移动版之Symbian(s80)版 1.00
  • 围棋死活习题集移动版之PocketPC 2002版 1.00

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • ASP源码
  • PHP源码
  • Net源码
  • JSP 源码

Oracle认证分类导航

  • Oracle动态
  • Oracle指导
  • Oracle题库

本类经典文章推荐

  • Oracle中关于逻辑备份与恢复
  • Oracle开发人员JAVA存储过程
  • 为数据库的表自动生成行号
  • Oracle中的OOP概念
  • 用java从oracle取数
  • 冷备份移植到另一台Solaris机器上
  • 如何将excel数据导入oracle中
  • Oracle10.2g安装记录
  • 数据库监控工具ForOraclev1.2
  • oracle双机群集系统

Oracle指导阅读排行

  • Oracle系统表查询
  • 实例:Oracle导出EXCEL文件
  • Oracle常用的OCI函数上
  • Oracle企业管理器(OEM 2.1)使用...
  • Tomcat+SQLServer连接池配置
  • 如何将excel数据导入oracle中
  • 如何取出某一用户的密码 再原样改...
  • 实例:Oracle导出EXCEL文件
  • 案例学习Oracle错误:ORA-00604
  • 案例学习Oracle错误:ORA-00060

Oracle认证阅读总排行

  • Oracle系统表查询
  • 实例:Oracle导出EXCEL文件
  • Oracle常用的OCI函数上
  • 在ORACLE的存储过程中如何做简单的...
  • Oracle企业管理器(OEM 2.1)使用...
  • Tomcat+SQLServer连接池配置
  • 如何将excel数据导入oracle中
  • AIX下自动启动Oracle数据库与监听...
  • 如何取出某一用户的密码 再原样改...
  • 实例:Oracle导出EXCEL文件

广告位置

字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 回到顶部

关于我们 | 版权声明 | 免责条款 | 广告联系 | 软件发布 | 下载帮助 | 下载排行 | 网站地图 | 特别鸣谢 | 友情连接

copyright; 2005-2008 D9soft.com 第九软件网 版权所有