在过程中使用插入语句!
我可以在过程中(在 Oracle 上)使用插入表吗?示例:
procedure my_procedure (aa1 number ,aa2 number ) is
begin
insert into lam_table values(aa1,aa2,null) ;(*ofcourse depending on the tables )
...
...
end ;
** 注意 我尝试了一下,它有效,但底部有一条消息说(成功编译未修改)
Can i use insert into tables in a procedure (on oracle) ? example:
procedure my_procedure (aa1 number ,aa2 number ) is
begin
insert into lam_table values(aa1,aa2,null) ;(*ofcourse depending on the tables )
...
...
end ;
** note
i tried it and it worked but there were a message in the bottom that said (successfully compiled not modified )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,你可以。只需注意创建过程和执行过程之间的区别即可。创建过程后,您可以使用以下命令执行它:
其中 aa1 和 aa2 是为 args 提供的值。
Yes, you can. Just be aware of the difference between creating the procedure and executing it. Once the procedure is created, you can execute it with:
where aa1 and aa2 are the supplied values for the args.
正如 dpbradley 所说。
此外,由插入语句执行的任何插入仅在该会话中可见,除非您执行
犯罪;
Just as dpbradley says.
Also, any insert performed by your insert statement will only be visible in that session unless you do a
commit;