使用PL/SQL关联数组

rea*_*aln 2 oracle plsql bulkinsert

create or replace aArr is TABLE of varchar2 index by binary_integer;
create or replace bArr is TABLE of varchar2 index by binary_integer;

create or replace prc(oname aArr, iname bArr) as
begin

--Now i have two arrays
-- i want to insert or update into table using these two arrays
-- How can i do that with out using the loops.
-- is there any bulk insert or update.

end
Run Code Online (Sandbox Code Playgroud)

现在我有两个数组.我想使用这两个数组插入或更新到表中.如何在不使用循环的情况下做到这一点?是否有批量插入或更新?

Oll*_*lie 7

如果您有PL/SQL关联数组,则可以使用批量处理使用FORALL将数据插入到基础数据库表中.

oracle文档在这里:http: //download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/forall_statement.htm

语法类似于:

FORALL x IN INDICES OF <associative_array_name>
   -- DML (INSERT or UPDATE etc)
Run Code Online (Sandbox Code Playgroud)

这是一个通用的答案,但你问了一个非常通用的问题.

希望这可以帮助...