Doubt-test procedure

Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc
  

Poston Wed, 08 Mar 2006 8:39 am

I have the following procedure:
Code: Select all
create or replace procedure P_INCLUIRTRANSACAOT1
(p_ip IN  BX_TBL_LOGERROR.IP%TYPE,
p_currentuser IN  BX_TBL_LOGERROR.USUARIO%TYPE,
p_Cursor out TYPES.cursorType)
 
IS 
  v_ErrorCode         varchar2(10);         
  v_ErrorMsg          VARCHAR2(200);   
  v_CurrentUser       VARCHAR2(20);   
  v_Ip                VARCHAR2(15);

BEGIN


declare
cursor c_Valores is

select distinct party_name,account_number,location 
from VIEW_GOL_AR_BAIXA_OPENSKIES;


v_party_name      varchar2(255);
v_account_number  varchar2(255);
v_location        varchar2(255);
v_registro        bx_tbl_agencia%rowtype;

begin
open c_Valores;
loop
fetch c_Valores into v_party_name,v_account_number,v_location;
exit when
c_Valores%NOTFOUND;

dbms_output.put_line(v_party_name || ' - ' || v_account_number || ' - ' || v_location);

 
open p_Cursor for

select *  from bx_tbl_agencia
where party_name     = v_party_name
and   account_number = v_account_number
and   location       = v_location;

if sql%notfound then
    insert into bx_tbl_agencia (party_name,account_number,location)
    values ('v_party_name','v_account_number','v_location');
end if;

end loop;
close c_Valores;
end;

EXCEPTION
  WHEN OTHERS THEN
    v_ErrorCode   := SQLCODE;
    v_ErrorMsg    := SQLERRM;
   
     ROLLBACK;

    INSERT INTO BX_TBL_LOGERROR(id,ip,error,errocode,usuario)
    VALUES (seq_Log.Nextval,p_Ip,v_ErrorMsg,v_ErrorCode,p_CurrentUser);

    COMMIT;

END p_IncluirTransacaoT1;
----------------------------------------------------------------------------------when she had only 2 parameters I tested like this: begin p_incluirtransacaot1 (' 1234567890 ', ' user ');
end;

Now the procedure has one more parameter (p_Cursor out TYPES. cursorType) how do I test this out parameter??

Grateful
izaura
Location: santos-sp

Poston Wed, 08 Mar 2006 10:44 am

You will have to pass a variable that will receive a value passed by the package.
Ricardo_Kaka
Location: São Vicente - SP


  • See also
    Replies
    Views
    Last Post


      Return to PL/SQL

      Who is online

      Users browsing this forum: Bing [Bot], Google [Bot] and 11 guests