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
现在我有两个数组。我想使用这两个数组插入或更新到表中。我怎样才能不使用循环来做到这一点?是否有任何批量插入或更新?
最佳答案
如果您有 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)
这是一个有点笼统的答案,但你问了一个非常笼统的问题。
希望这有助于...
关于oracle - 使用 PL/SQL 关联数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7348526/