APEX 3.0 on XE part 2

On 29 Februari 2008 Oracle released Application Express 3.1 . With this release you can upgrade the Application Express within Oracle XE to 3.1. For more information on this topic see Oracle Database XE and Application Express 3.1 and APEX 3.1 on XE .

If you followed the (more...)

Enumeration types in PL/SQL?

In the book Oracle PL/SQL for DBAs the definition of the type BOOLEAN is shown:

SELECT text
FROM all_source
WHERE owner = 'SYS'
AND type = 'PACKAGE'
AND name = 'STANDARD'
AND line <5
/

TEXT
-------------------------------------------------------------
package STANDARD AUTHID CURRENT_USER is

/********** Types and subtypes, do not reorder **********/
type BOOLEAN is (FALSE, TRUE);

4 rows selected.

Have you seen that kind of type definition before? I did, it looks like a Delphi enumeration type when you replace the is with = . Let's define our own type.

create package TRAFFIC is 
type LIGHT_T is (RED, YELLOW, GREEN);
end;
/

Warning: Package created with compilation errors.

SHOW ERR

LINE/COL TEXT
-------------------------------------------------------------
2,19 PLS-00505: User Defined Types may only be defined
as PLSQL Tables or Records
2,3 PL/SQL: Declaration ignored

2 rows selected

Perhaps this is an enhancement request for Oracle 11g release 2?