-- Created on 2010/05/07 by NAN
declare
-- Local variables here
TYPE numtab IS TABLE OF NUMBER(20 ) INDEX BY BINARY_INTEGER ;
TYPE nametab IS TABLE OF VARCHAR2 (50) INDEX BY BINARY_INTEGER;
pnums numtab;
pnames nametab;
t1 NUMBER;
t2 NUMBER;
t3 NUMBER;
ERRORS NUMBER;
begin
FOR j IN 1 .. 1000
LOOP
pnums(j) := j;
pnames(j) := 'Seq No. ' || to_char(j);
END LOOP ;
SELECT dbms_utility.get_time
INTO t1
FROM dual;
FOR i IN 1 .. 1000
LOOP
INSERT INTO blktest
VALUES
(pnums(i)
,pnames(i));
END LOOP ;
SELECT dbms_utility.get_time
INTO t2
FROM dual;
pnums.delete( 10);
pnums.delete( 15);
FORALL i IN 1 .. 1000 SAVE EXCEPTIONS
INSERT INTO blktest
VALUES
(pnums(i)
,pnames(i));
SELECT dbms_utility.get_time
INTO t3
FROM dual;
dbms_output.put_line( 'Execution Time (hsecs)');
dbms_output.put_line( '---------------------');
dbms_output.put_line( 'FOR loop: ' || to_char(t2 - t1));
dbms_output.put_line( 'FORALL: ' || to_char(t3 - t2));
COMMIT;
EXCEPTION
WHEN OTHERS THEN
ERRORS := SQL%BULK_EXCEPTIONS.COUNT;
FOR i IN 1 .. SQL%BULK_EXCEPTIONS.count LOOP
dbms_output.put_line( SQL%BULK_EXCEPTIONS (i).ERROR_INDEX);
dbms_output.put_line( SQL%BULK_EXCEPTIONS (i).ERROR_CODE);
END LOOP ;
dbms_output.put_line( SQLERRM);
COMMIT;
end;
分享到:
相关推荐
- 支持Oracle Linux 6和Red Hat Enterprise Linux 6 Distributions for x86-64 - 支持Oracle Linux 5和Red Hat Enterprise Linux 5 Distributions for x86-64 - 支持SUSE Distributions for x86-64 ##### 2.3 ...
ORACLE常用命令 一、ORACLE的启动和关闭 1、在单机环境下 要想启动或关闭ORACLE系统必须首先切换到ORACLE用户,如下 su - oracle a、启动ORACLE系统 oracle>svrmgrl SVRMGR>connect internal SVRMGR>startup ...
2. 检查备份:`db2 list backup history all` 3. 恢复数据库:`db2 restore database mydb from '/backup'` 七、监控与性能调优 1. 查看数据库状态:`db2pd -db mydb` 2. 监控数据库性能:`db2top` 3. 调整DB2配置...
Oracle 10g数据库系统是Oracle公司发布的一个版本,提供了丰富的功能和强大的性能。在数据库管理中,有时候我们需要查找所有包含特定字段的表,这对于数据治理、数据分析或优化查询性能非常有帮助。以下是如何在...
5. **BULK COLLECT和FORALL**:为了提高效率,当从数据库大量导出数据时,可以使用PL/SQL的BULK COLLECT语句收集数据,然后使用FORALL语句批量插入到Excel文件。 6. **外部表**:Oracle的外部表功能允许将文件系统...
- `linux_11gR2_database_1of2` - `linux_11gR2_database_2of2` - `linux_11gR2_grid` 以上文件均可从 Oracle 官方网站下载: - [下载地址]...
unreadable Consider for example the simple question: How does Oracle do a logical I O then take a look at structure x$kcbsw which is a list of all the functions that Oracle might call to visit a ...
The FORALL statement can handle associate arrays and nested tables with deleted elements. You can now use this performance construct in more situations than before, and avoid the need to copy elements...
Changing password for user oracle. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: passwd: all authentication tokens updated successfully. 创建grid目录结构...
- Toad for Oracle - PL/SQL Developer - SQL Server Management Studio (适用于跨平台) - **SQL在编程中的应用:** - SQL通常与各种编程语言结合使用,例如Java、Python、C#等。 - 数据持久层技术如JDBC、ADO...
That is the Oracle code !! You can use it improve your ability!! You know if you don't use the DATABASE and The Commnad that you...All example in the RAR File!! Hope you can use it and it can help you!!!
- **Example of Configuring Block Device Storage for Oracle Clusterware**:配置块设备存储的具体示例。 - **Example of Creating...** 通过上述详细的内容,我们可以看出文档提供了从软件要求、硬件配置、...
- The script to which the character belongs is supported by the JRE installation on which SQL Developer is running � for example, appropriate fonts are available � and - The script does not ...
Suppose your company wants to sell products online. You have a database that gives the price and inventory status of each item. However, your database doesn’t speak ...Web browsers need.... For example,
2. The PHPRC environment variable. (As of PHP 5.2.0) ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) ; 4. Current working directory (except CLI) ; 5. The web server's directory...
For example, they can specify whether a trigger should be executed before or after a DML operation, or whether it should be executed for each row or for the entire statement. This level of control ...
Chapter 5, PL/Vision Package Specifications provides a brief summary of all of the specifications for the PL/Vision packages, and is marked with a thumb-tab for quick reference. Part III: Building ...
Written by a MySQL Community Manager for Oracle, MySQL and JSON: A Practical Programming Guide shows how to quickly get started using JSON with MySQL and clearly explains the latest tools and ...
users = session.query(User).all() for user in users: print(user.name, user.email) # 更新数据 john = session.query(User).filter_by(name='John').first() john.email = 'newemail@example.com' session....
Preset code formatting rule added for Oracle VARRAY. Preset code formatting rule added for DEFAULT VALUES in INSERT/UPDATE statements in Transact-SQL. Database name and schema name completion is now...