Home » SQL & PL/SQL » SQL & PL/SQL » Executing subprocedure (Oracle 10g)
Executing subprocedure [message #404715] Sat, 23 May 2009 00:46 Go to next message
ramesh55.sse
Messages: 262
Registered: December 2008
Location: Hyderabad
Senior Member
How can we execute subprocedure.Please help me

create or replace procedure mainproc
is
v_empno number;
procedure subproc
is
begin
insert into emp8 values(100,'ramesh');
end;
begin
select empno into v_empno from emp where ename='SMITH';
dbms_output.put_line(v_empno);
end;
/
exec mainproc

But how can we execute subproc
Re: Executing subprocedure [message #404721 is a reply to message #404715] Sat, 23 May 2009 01:07 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
What do you mean by how can I execute?
How are you executing the main procedure?
Do you know any other process to execute a procedure except using "exec"?
Don't you know the scope concept?

Call the sub procedure in the main procedure.

By
Vamsi
Re: Executing subprocedure [message #404738 is a reply to message #404715] Sat, 23 May 2009 01:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
But how can we execute subproc

You first must have a code that compiles.

AND FOLLOW THE POSTING GUIDELINES.

Regards
Michel
Re: Executing subprocedure [message #404741 is a reply to message #404715] Sat, 23 May 2009 02:11 Go to previous messageGo to next message
vigneshbemba
Messages: 17
Registered: April 2007
Location: chennai
Junior Member
Also,instead of embedding the subproc inside the main procedure try to create the subproc seperately and call the subproc inside the main procedure.
Re: Executing subprocedure [message #404854 is a reply to message #404741] Mon, 25 May 2009 00:56 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
vigneshbemba wrote on Sat, 23 May 2009 09:11
Also,instead of embedding the subproc inside the main procedure try to create the subproc seperately and call the subproc inside the main procedure.

Why? If he wants to embed this function, there might be a good reason for it.
Now, if you would have advised him to put both inside a package and make the embedded function private and the other public, then I would agree.
Re: Executing subprocedure [message #404856 is a reply to message #404854] Mon, 25 May 2009 01:05 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
If he wants to embed this function, there might be a good reason for it.


./fa/449/0/

Re: Executing subprocedure [message #404896 is a reply to message #404715] Mon, 25 May 2009 05:57 Go to previous messageGo to next message
ashoka_bl
Messages: 398
Registered: November 2006
Location: Bangalore
Senior Member

@ramesh55.sse,

I really know how to do it Smile , do you let us know why do you want it and what have you tried so far..
Re: Executing subprocedure [message #404897 is a reply to message #404896] Mon, 25 May 2009 06:06 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I really know how to do it

Do you? Who doesn't? Only those that don't read a little bit of documentation.

Quote:
do you let us [...] what have you tried so far..

Is this not in the first post? Of course, it is not formatted.

Regards
Michel
Re: Executing subprocedure [message #404900 is a reply to message #404715] Mon, 25 May 2009 06:09 Go to previous messageGo to next message
ashoka_bl
Messages: 398
Registered: November 2006
Location: Bangalore
Senior Member

@Michel,

Don't get offended sir...cool down, I thought that the OP hasn't answered/responded for a while, so was wondering what's going on and posted.
Re: Executing subprocedure [message #404907 is a reply to message #404900] Mon, 25 May 2009 07:08 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I thought that the OP hasn't answered/responded for a while

He NEVER answers to any of his numerous questions. It was just to warn you and prevent from wasting your time.

Regards
Michel
Previous Topic: delete query taking lot of time
Next Topic: Comparing the resulset of cursor with table column data
Goto Forum:
  


Current Time: Sat Dec 03 17:49:06 CST 2016

Total time taken to generate the page: 0.07220 seconds