Undocumented PL/SQL Syntax. Keyword "private"
Hi,
i am a PL/SQL-programmer and an Ada programmer too. I know that PL/SQL is derived from Ada83. Now since i am used to Ada somtimes i write Ada syntax elements in PL/SQL code. Normally the PL/SQL-compiler complains and does not compile. But look at the following example:
create or replace package privatetest is
var varchar2(100):='Test';
procedure test;
private -- not documented keyword
privatevar varchar2(100):='Test';
end privatetest;
/
create or replace package body privatetest is
procedure test
is
l_var varchar2(100);
begin
l_var:=privatevar;
privatevar:=l_var;
end test;
end privatetest;
/
This can be compiled with PL/SQL version 10.2.0.4.0. Private parts of package sec are normal in Ada since Ada allows child packaging and then you need this hiding mechanism. In some more complex situations i encountered strange behavior at runtime if "private" is used in PL/SQL.
Question: Is it a historical rudiment that the compiler accepts the keyword or ist it planned to allow private parts and child packaging in future releases of PL/SQL?
Regards,
Frank Piron