0

I wrote this procedure:

  create or replace PROCEDURE num_mandati ( persona IN parlamento2018.parlamentari.cf%type default '1234567890ABCDEF') IS  
     nomePersona parlamentari.nome%type;
     cognomePersona parlamentari.cognome%type;
     n_codfis           NUMBER := 0;
     nessunParlamentare EXCEPTION;


  BEGIN

    dbms_output.put_line('persona: ' ||persona);
  END num_mandati;

In the body of procedure there is an output instruction but the default value of the parameter 'persona' is not displayed. The type of the column cf of the parlamentari's table is varchar2(16). Why the parameter's value is not displayed?

0

1 Answer 1

1

Without knowing the way you call the procedure, I see two possible reasons: you did not SET SERVEROUTPUT ON or you passed a NULL value:

SQL> exec num_mandati;

PL/SQL procedure successfully completed.

SQL> SET SERVEROUTPUT ON
SQL> exec num_mandati;
persona: 1234567890ABCDEF

PL/SQL procedure successfully completed.

SQL> exec num_mandati('');
persona:

PL/SQL procedure successfully completed.

SQL>
Sign up to request clarification or add additional context in comments.

2 Comments

I wrote this procedure in the oracle's 11g ide, not in sql*plus. I don't use SET SERVEROUTPUT ON because the result is displayed in the ide. Anyhaw I set the default parameter in the procedure's signature and do not understand because the parameter 'persona' result set to null
Here the question is about the way you call the procedure. Also, what do you mean with "oracle's 11g ide"? Oracle SQLDeveloper? a third part tool?

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.