Someone can give me a tip.
How do I do to run a procedure within another and return the records of this procedure that was called to the call procedure?
Thanks for the attention.
Procedure
-
- Rank: Estagiário Sênior
- Posts: 11
- Joined: Fri, 23 Jul 2010 10:18 am
- Location: Igrejinha RS
Marlon Jardel
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
- fsitja
- Rank: OraSauro
- Posts: 611
- Joined: Mon, 19 Jan 2009 4:29 pm
- Location: Gaúcho no Rio de Janeiro - RJ
"The scars exist to remind us that the past was real"
Campanha: Como fazer uma pergunta e obter uma resposta.
http://tkyte.blogspot.com/2005/06/how-t ... tions.html
OCA & OCP Developer — OCE SQL Expert — OCS Data Warehousing Specialist
Campanha: Como fazer uma pergunta e obter uma resposta.
http://tkyte.blogspot.com/2005/06/how-t ... tions.html
OCA & OCP Developer — OCE SQL Expert — OCS Data Warehousing Specialist
It seems to me that you want something like using Ref cursor as the output parameter of the procedure.
put a little more information about the problem, what you need to solve instead of the solution you thought. Maybe it will give rethinking the solution simplely, looking from another angle.
put a little more information about the problem, what you need to solve instead of the solution you thought. Maybe it will give rethinking the solution simplely, looking from another angle.
-
- Rank: Estagiário Sênior
- Posts: 11
- Joined: Fri, 23 Jul 2010 10:18 am
- Location: Igrejinha RS
Marlon Jardel
The procedure is + or - so.
create procedure X(p1,p2)
variaveis
begin
...
...
...
executar procedure_chamada(P1,P2);
retornar valor;
...
...
end;
-
- Rank: Oracle Guru
- Posts: 448
- Joined: Tue, 16 Jun 2009 3:07 pm
- Location: Parobé - RS
Sérgio Luiz Bonemberger Junior
Programador Junior
Parobé RS
[]s
Programador Junior
Parobé RS
[]s
You just need your call procedure to have a type out parameter.
Dae The field that you pass in this parameter will return what you wish from the procedure.
An example:
Dae The field that you pass in this parameter will return what you wish from the procedure.
An example:
create procedure chamada(p1 in number,p2 out boolean) is
begin
if p1 = 1 then
p2:= true;
else
p2 := false;
end if;
end;
-
- Rank: Estagiário Sênior
- Posts: 11
- Joined: Fri, 23 Jul 2010 10:18 am
- Location: Igrejinha RS
Marlon Jardel
yes, but what is the command I use to call this procedure, I created it with 4 parameters, 3 of them are in (input) and 1 out (output)
I am running it as follows: These are the input parameters, now I want to play within a variable in another procedure the output parameter. how do I do that.
When calling the procedure the way I put above, it accuses an error:
Incorrect number of argument types in the call to name_procedure.
I am running it as follows:
nome_procedure(p1,p2,p3);
When calling the procedure the way I put above, it accuses an error:
Incorrect number of argument types in the call to name_procedure.
-
- Rank: Estagiário Sênior
- Posts: 11
- Joined: Fri, 23 Jul 2010 10:18 am
- Location: Igrejinha RS
Marlon Jardel
Thanks for personal help.
I found another topic in the forum that solved my problem
http://en.glufke.net/oracle/viewtopic.p ... metros+out
When passing the parameters to the procedure, I must inform the input parameters and a variable that You will receive the output value of the procedure.
Ex:
Thanks for the attention of all.
I found another topic in the forum that solved my problem
http://en.glufke.net/oracle/viewtopic.p ... metros+out
When passing the parameters to the procedure, I must inform the input parameters and a variable that You will receive the output value of the procedure.
Ex:
nome_procedure(entrada1,entrada2,entrada3,variavel_que_recebe_saida) ;
Thanks for the attention of all.
- gpilger
- Rank: Programador Júnior
- Posts: 29
- Joined: Wed, 21 Apr 2010 3:34 pm
- Location: Novo Hamburgo - RS
Gilson Pilger
"Por não saber que erra impossível, ele foi lá e fez" autor desconhecido
"Por não saber que erra impossível, ele foi lá e fez" autor desconhecido
To call a procedure within another just declare the internal procedure in the "Declare" section of the PL / SQL block.
Example:
Example:
create or replace procedure prc_externa (pA in, pB in) is
declare
-- Minha procedure interna
procedure prc_interna(p1 in, p2 out) is
begin
aqui vai meu código;
end prc_interna;
var_out varchar2(10);
begin
-- aqui chamo minha proc interna
prc_interna('valor 1',var_out);
end prc_externa;
-
- Information
-
Who is online
Users browsing this forum: No registered users and 14 guests