Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Cannot insert data when there is "select ... into..." in stored procedure
In message <1167908289.603934.281040_at_31g2000cwt.googlegroups.com>,
cherryparadise001_at_gmail.com writes
>Hi All,
>
>I am doing database programming using VB.Net and Oracle DB 8.1.7.
>when there is command "select ...into..." in the following procedure,
>it doesn't insert anything and also no error return to the application.
>When I comment those command, it does insert records even they are
>null.
>What's wrong with my select statement?
>I can select value when I run the command in sqlplus.
>Anyone can have idea?
>
What happens when you run the procedure in sql*plus?
e.g.
begin
insert_template_detail(....);
end;
/
You are almost certainly getting an exception which causes any of the code following to be skipped.
You should use begin...exception...end blocks in your procedure to trap errors and give meaningful messages.
You should also check the error return in your vb.net code.
-- Jim Smith Ponder Stibbons Limited <http://oracleandting.blogspot.com/> RSS <http://oracleandting.blogspot.com/atom.xml>Received on Thu Jan 04 2007 - 07:20:50 CST