use insert statement into a procedure !
Can i use insert into tables in a procedure (on oracle) ? example:
procedure my_p开发者_JAVA百科rocedure (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 )
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:
begin
my_procedure(aa1, aa2);
end;
where aa1 and aa2 are the supplied values for the args.
Just as dpbradley says. Also, any insert performed by your insert statement will only be visible in that session unless you do a commit;
精彩评论