problem compiling an objec type

greg.mccarty

Member²
Ok, I'm trying to compile the object type example for rectangle found in chapter 10 of the pl/sql user's guide and reference (oracle version 9.2.0.5.0)

Here it is:
CREATE OR REPLACE TYPE rectangle AS OBJECT
(
length NUMBER,
width NUMBER,
area NUMBER,

CONSTRUCTOR FUNCTION rectangle(l NUMBER, w NUMBER)
RETURN SELF AS RESULT
);

If I compile it in a package window, I get the error PLS-00658 (constructor method name must match type name) and the cursor is position on the first letter of the word FUNCTION.

If I compile it in a command window, it compiles fine.

Anyone know why this happens?

I'm using plsql dev version 6.0.5.931
 
Could you check if the "Safe compilation" preference is enabled (Tools > Preferences > Program Window). It will first attempt to compile the type under a different name, but there is a bug concerning constructors.
 
Back
Top