 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
johnblaze
Joined: 12 Oct 2011 Posts: 2 Country: Russian Federation |
|
Local variables in inner subprograms |
|
SQL Assistant 6.2.112
Notepad++ 6.1.6
Oracle Database 11g (11.2.0.2)
The SQL Assistant doesn't display the "Local variables" section after an inner subprogram inside an Oracle package.
Example:
There is a package body. The package body consists of two subprograms (outer_func1 and outer_proc1). The outer_func1 subprogram has two inner (local) subprograms (inner_proc1 and inner_func2). Please find the code of the package body below.
 |
 |
1 create or replace package body pkg1
2 as
3 function outer_func1 (
4 outer_func1_p1 in pls_integer
5 , outer_func1_p2 in varchar2
6 )
7 return pls_integer
8 is
9 i pls_integer;
10
11 procedure inner_proc1 (
12 inner_proc1_p1 in pls_integer
13 , inner_proc1_p2 in varchar2
14 )
15 is
16 begin
17 null;
18
19 end inner_proc1;
20
21 function inner_func2 (
22 inner_func2_p1 in pls_integer
23 , inner_func2_p2 in varchar2
24 )
25 return boolean
26 is
27 begin
28 return true;
29
30 end inner_func2;
31
32 begin
33
34 i := case
35 when outer_func1_p1 = 1 then
36 2
37 else
38 3
39 end;
40
41 return i;
42
43 end outer_func1;
44
45 function outer_proc1 (
46 outer_proc1_p in number
47 )
48 is
49 begin
50 dbms_output.put_line( outer_proc1_p );
51
52 end outer_proc1;
53
54 end pkg1;
55 /
|
Try to invoke (Ctrl+Space) the SQL Assistant on different lines of the script and look at the outcome:
a) The 10th line. There is the "Local variables" section with "outer_func1_p1", "outer_func1_p2" and "i" in it. The behavior is as expected.
b) The 18th line. There is the "Local variables" section with "outer_func1_p1", "outer_func1_p2", "i", "inner_proc_p1" and "inner_proc_p2" in it. The behavior is as expected.
c) The 29th line. There are "inner_func2_p1" and "inner_func2_p2" parameters only. Should be "outer_func1_p1", "outer_func1_p2", "i", "inner_func2_p1" and "inner_func2_p2".
d) The 33rd line. There is no the "Local variables" section. Should be "outer_func1_p1", "outer_func1_p2" and "i" in the section.
e) The 51st line. There is "outer_proc1_p" in the "Local variables" section. The behavior is as expected.
Please note that instead of the package body can be a type body or some inner subprograms, in their turn, can also have inner subprograms - the outcome will be the same.
The subject is related to http://www.softtreetech.com/support/phpBB2/viewtopic.php?t=23609.
|
|
Tue Sep 25, 2012 7:54 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Thank you for your feedback. I believe the built-in PL/SQL parser chocks on the inner function, it doesn't know how to handle that syntax. SQL Assistant doesn't currently support parsing of inner functions. As a result, the "Local variables" cannot be found and that section is missing in the popup.
I'm going to submit an enhancement request for implementing parsing of package inner functions and procedures.
|
|
Tue Sep 25, 2012 10:23 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|