How to declare "nullable" parameters in an Oracle procedure?

2

I need my procedure to accept null values in some parameters of type Number. How do I do this in PL / SQL?

Currently:

PROCEDURE SP_EDITAR_QUADRO(
    P_IDQUADRO IN NUMBER,
    P_IDFUNC IN NUMBER,
    P_IDTRAB IN NUMBER
);
...

I need the P_IDTRAB parameter to accept null values.

    
asked by anonymous 16.11.2017 / 18:43

1 answer

1

You can do this by the operator DEFAULT or :=

PROCEDURE ADD(aNUMBER, b NUMBER, c NUMBER DEFAULT 0)

If you use signed packages, remember to replicate the process.

If you want to use it without explicit naming of parameters in calls, you should place your optional parameters at the end of the procedure signature list.

Read More

    
16.11.2017 / 18:44