Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Undocumented PL/SQL Syntax. Keyword "private"

user5200696Jul 27 2010 — edited Jul 27 2010
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
This post has been answered by 635471 on Jul 27 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 24 2010
Added on Jul 27 2010
18 comments
2,391 views