关于ORACLE PLSQL读文件
转自:http://www.oracle.com/technology/obe/obe9ir2/obe-cnt/plsql/plsql.htm
都说读书不求甚解害死人,一点也不错,最近我从网上淘到关于ORACLE如何从数据库目录下读文件,于是就用于生产了,结果上了生产,程序死活就是跑不出来,原因是我们的服务器做了REC,如果在两台机器上找一个目录呢,以前呢在自己的程序里把路径写死了,在一般服务器上验证也没有问题,可是如果是双机呢?就不行了,那我们只好通过共享目录来实现,可是有了目录,程序还是找不到绝对路径,怎么办呢,看下面的程序,它都是在数据库里创建了一个DIRECTORY,修改成它,问题迎刃而解。
通过下面的例子,好好研究一下ORACLE提供给我们的功能吧!
Using New PL/SQL Features to Enhance Applications
Module Objectives
Purpose
This module describes how to utilize some of the latest PL/SQL capabilities to optimize performance and increase the efficiency of your PL/SQL applications..
Objectives
Upon completion of this module, you should be able to:
Use an Associative Array
Use the UTL_FILE package to manage access to directories, handle raw data, and copy, rename and delete files
Use Bulk binding in native dynamic SQL
Use PL/SQL RECORDs to access and manipulate changes to the database
Prerequisites
The prerequisites for this lesson are:
Completed the Preinstallation Tasks module
Completed the Installing the Oracle9i Database module
Download and unzip plsql.zip into your working directory
Reference Material
The following list represents some useful reference material should you need additional information on the topics in this module:
Documentation: PL/SQL User's Guide and Reference
Documentation: Supplied PL/SQL Packages and Types Reference
PL/SQL Whitepapers and Code Examples on OTN
Overview
The features you will explore in this lesson are:
1.
Using Associative Arrays
2.
Using the UTL_FILE Package
3.
Using Bulk Binding in Native Dynamic SQL
4.
Using PL/SQL Records
Using Associative Arrays
Back to List
In Oracle9i Database Release 2, PL/SQL index-by tables, now known as associative arrays, have been extended to allo
相关文档:
昨天面试被问到了分段统计,我知道decode可以,面试官接着要我说decode的语法,没回答上来.从网上找的资料稍微改了一下.
DECODE函数是ORACLE PL/SQL是功能强大的函数之一,目前还只有ORACLE公司的SQL提供了此函数,其他数据库厂商的SQL实现还没有此功能。
&nb ......
Oracle的分区技术在某些条件下可以极大的提高查询的性能,所以被广泛采用。从产品上说,分区技术是Oracle企业版中独立收费的一个组件。以下是对于分区及本地索引的一个示例。
Oracle的分区技术在某些条件下可以极大的提高查询的性能,所以被广泛采用。从产品上说,分区技术是Oracle企业版中独立收费的一个 ......
http://www.csip.com.cn/88/n-52488.html
关于分区表和分区索引(About Partitioned Tables and Indexes)对于10gR2而言,基本上可以分成几类:
Range(范围)分区
Hash(哈希)分区
List(列表)分区
以及组合分区:Range-Hash,Range-List。
对于表而言(常规意义上的堆组织表),上述分区形式都可以应用(甚至可以对某个 ......
实现方法:
1、开始->设置->控制面板->管理工具->服务停止所有Oracle服务。
2、开始->程序->Oracle - OraHome81->Oracle Installation Products->Universal Installer
卸装所有Oracle产品,但Universal Installer本身不能被删除
&nb ......
1.OS认证
Oracle安装之后默认情况下是启用了OS认证的,这里提到的os认证是指服务器端os认证。OS认证的意思把登录数据库的用户和口令校验放在了操作系统一级。如果以安装Oracle时的用户登录OS,那么此时在登录Oracle数据库时不需要任何验证,如:
SQL> connect /as sysdba
已连接。
SQL> connect sys/aaa@te ......