Run oracle Procedure

Asked

Viewed 47,156 times

3

I created this protocol, but I can’t execute it. I have the following error when trying Execute:

PLS-00306: incorrect number of argument types in call to 'SP_CARTAO'

CREATE OR REPLACE PROCEDURE SP_CARTAO
(
   P_ID IN INT ,
   P_ID_CARTAO OUT INT
)
AS
BEGIN
  SELECT ID_CARTAO INTO P_ID_CARTAO
  from log_cartao
  where log_cartao.id_cartao = P_ID;
END;

EXECUTE SP_CARTAO(1);

1 answer

5

The process expects 2 parameters but you are passing only one parameter to it.

To pass an output parameter to a stored Oracle database, you can do so:

declare
P_ID_CARTAO number;
begin
EXECUTE SP_CARTAO(1, P_ID_CARTAO);
-- aqui, a variável P_ID_CARTAO terá o valor que foi setado pela stored procedure
end;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.