使用 PL/SQL 关联数组

发布于 2024-12-03 11:09:21 字数 464 浏览 4 评论 0原文

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

现在我有两个数组。我想使用这两个数组插入或更新表。我怎样才能在不使用循环的情况下做到这一点?是否有批量插入或更新?

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

听不够的曲调 2024-12-10 11:09:21

如果您有 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)

语法 有点笼统的答案,但你问了一个非常笼统的问题。

希望这有帮助...

If you have PL/SQL associative arrays, you can use bulk processing to insert the data into underlying database tables using FORALL.

The oracle documantation is here:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/forall_statement.htm

The syntax is similar to:

FORALL x IN INDICES OF <associative_array_name>
   -- DML (INSERT or UPDATE etc)

It's a bit of a generic answer but you have asked a very generic question.

Hope this helps...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文