0

I have a procedure something like

       create or replace package pack_body
         as
        procedure export(P_LOCATION_ID number
                         ,retcode OUT   NOCOPY   NUMBER)
         as
         ----body
        end;

I am calling this package in another package

pack_body.export(p_location_id => null);

At this line it is going into error:

Error(28412,5): PLS-00306: wrong number or types of arguments in call to 'EXPORT'

I cannot pass null into number data type variable ?

2
  • 1
    Try passing in the second argument, retcode. Commented Jan 14, 2016 at 13:22
  • Its an out parameter.... what should i pass.. in this Commented Jan 14, 2016 at 13:25

2 Answers 2

4

You need to pass both arguments to the procedure:

DECLARE
  rc NUMBER;
BEGIN
  pack_body.export(
    p_location_id => null,
    retcode       => rc
  );
END;
/
Sign up to request clarification or add additional context in comments.

Comments

0

Since thisretcode is an OUT parameter,it means that a value is being returned from that particular procedure pack_body.export and is being assigned in the variable retcode

so while calling this procedurepack_body.export you need to declare some local variable in your procedure of same data type in which the value of retcode can be assigned. Hence you getting this error.

You cannot use null as assignment target hence you need to declare a varible locally of same datatype

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.