1

Topic: Whether can simple_integer be out - parameter?

Swears

declare
sint simple_integer;
procedure tst (sint out simple_integer) is
begin
sint: = 1;
dbms_output.put_line (sint);
end;
begin
tst (sint);
end;

And

declare
sint simple_integer: =1;
procedure tst (sint out simple_integer) is
begin
sint: = 1;
dbms_output.put_line (sint);
end;
begin
tst (sint);
end;

Does not swear

declare
sint simple_integer: =1;
procedure tst (sint in out simple_integer) is
begin
sint: = 1;
dbms_output.put_line (sint);
end;
begin
tst (sint);
end;

It and is conceived, and I am not able to use the documentation?
Explain who than can, please

2

Re: Whether can simple_integer be out - parameter?

.. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

3

Re: Whether can simple_integer be out - parameter?

IMHO undocumented a feature for Not null
The variable that OUT, but to it to appropriate any value at initialization it is necessary.... And what?

4

Re: Whether can simple_integer be out - parameter?

Leonid Kudryavtsev wrote:

IMHO undocumented a feature for Not null
The variable that OUT, but to it to appropriate any value at initialization it is necessary.... And what?

So in the second example I followed the tastes (not clear me) and appropriated. Has been roughly sent on ORA-06502: PL/SQL: numeric or value error

5

Re: Whether can simple_integer be out - parameter?

The code which shows my thought:
[spoiler]

declare
sint simple_integer: = 1;
procedure tst1 (sint out NOCOPY pls_integer) is - not IN
begin
dbms_output.put_line (' pls_integer BEFORE ' || NVL (TO_CHAR (sint), ' NULL '));
sint: = 2;
dbms_output.put_line (sint);
end;
procedure tst (sint in out NOCOPY simple_integer) is
begin
dbms_output.put_line (' simple_integer BEFORE ' || sint);
sint: = 3;
dbms_output.put_line (sint);
end;
begin
tst1 (sint);
tst (sint);
end;

[/spoiler]

6

Re: Whether can simple_integer be out - parameter?

legg wrote:

it is passed...
So in the second example I followed the tastes (not clear me) and appropriated. Has been roughly sent on ORA-06502: PL/SQL: numeric or value error

You appropriated OUT OF procedure.
And in procedure, in the performance beginning, it appeared NULL, since NOT IN

7

Re: Whether can simple_integer be out - parameter?

Leonid Kudryavtsev wrote:

the Variable that OUT, but any value to it to appropriate at initialization it is necessary.... And what?

And after all  the reptile default value for parameter in the signature of procedure does not allow to specify.

8

Re: Whether can simple_integer be out - parameter?

Leonid Kudryavtsev;
Understood I think. Indeed. Could to guess itself also. Thanks!
But all the same... As that is bad from outside  it explicitly in the documentation not to write. For the stupid.

9

Re: Whether can simple_integer be out - parameter?

Leonid Kudryavtsev wrote:

it is passed...
You appropriated OUT OF procedure.
And in procedure, in the performance beginning, it appeared NULL, since NOT IN

Yes. I understood. Chewed. Thanks once again.

10

Re: Whether can simple_integer be out - parameter?

legg wrote:

understood I think. Indeed. Could to guess itself also. Thanks!
But all the same... As that is bad from outside  it explicitly in the documentation not to write. For the stupid.

+
The message on errors too drove me in an easy stupor

AmKad wrote:

And after all  the reptile default value for parameter in the signature of procedure does not allow to specify.

+
PLS-00230: OUT and IN OUT formal parameters may not have default expressions

11

Re: Whether can simple_integer be out - parameter?

Leonid Kudryavtsev wrote:

PLS-00230: OUT and IN OUT formal parameters may not have default expressions

Well and I about it.

12

Re: Whether can simple_integer be out - parameter?

[quote =-2] it is passed...
it is passed...
As syntax plsql does not allow to set default for subtype,

You are possibly right. But, all the same, reading the specified points and without foreknowing result, I could not foretell confidently that the second anonymous unit from a subject will not be compiled. And phrases, similar "In overloaded subprograms, SIMPLE_INTEGER and PLS_INTEGER actual parameters can be substituted for each other." - would confuse even more. Probably it is personally my slowness fault, and much all is obvious at once smile.
.. As it is good that is sql.ru