CREATE TABLE blktest (num NUMBER( 20), name varchar2( 50));
CREATE OR REPLACE PROCEDURE bulktest IS
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;
BEGIN
FOR j IN 1 .. 1000000
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 .. 1000000
LOOP
INSERT INTO blktest
VALUES
(pnums(i)
,pnames(i));
END LOOP ;
SELECT dbms_utility.get_time
INTO t2
FROM dual;
FORALL i IN 1 .. 1000000
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));
END;
Execution Time (hsecs)
---------------------
FOR loop: 5747
FORALL: 90
分享到:
相关推荐
- 支持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 ...
假设我们要找的字段名为“example_field”,可以编写如下SQL语句: ```sql SELECT table_name FROM all_tab_columns WHERE column_name = 'example_field'; ``` 这段代码会返回所有包含“example_field”这一列的...
5. **BULK COLLECT和FORALL**:为了提高效率,当从数据库大量导出数据时,可以使用PL/SQL的BULK COLLECT语句收集数据,然后使用FORALL语句批量插入到Excel文件。 6. **外部表**:Oracle的外部表功能允许将文件系统...
**6.6 选择“Use the Same Password for all Accounts”** 选择使用相同的密码为所有账户。 **6.7 选择“Automatic Storage Management (ASM)”** 选择使用 ASM 存储管理方式。 **6.8 配置快速恢复区** 配置...
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目录结构...
3. 切换用户:`db2set DB2_COMPATIBILITY_VECTOR=ORACLE` 4. 通过新用户登录:`db2 connect to mydb user myuser using 'mypassword'` 六、备份与恢复 1. 备份数据库:`db2backup database mydb to '/backup'` 2. ...
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!!!
- Toad for Oracle - PL/SQL Developer - SQL Server Management Studio (适用于跨平台) - **SQL在编程中的应用:** - SQL通常与各种编程语言结合使用,例如Java、Python、C#等。 - 数据持久层技术如JDBC、ADO...
- 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 ...
- **Example of Configuring Block Device Storage for Oracle Clusterware**:配置块设备存储的具体示例。 - **Example of Creating...** 通过上述详细的内容,我们可以看出文档提供了从软件要求、硬件配置、...
You can redirect all of the output of your scripts to a function. For ; example, if you set output_handler to "mb_output_handler", character ; encoding will be transparently converted to the ...
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 ...
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 ...
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 ...
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...
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....
Support has been added for Oracle12c extended strings (> 4000 bytes) The align button has a new Hide editor option to show only the result set The align button has a new Window width option to resize ...