Object types and methods
Hi,
I was just trying object methods and types. I wrote the followin piece of code for the object:
CREATE TYPE OBJ_NEW AS OBJECT
(
X NUMBER(4),
Y NUMBER(4),
MEMBER FUNCTION ADDITION RETURN INTEGER
)
/
CREATE TYPE BODY OBJ_NEW AS
MEMBER FUNCTION ADDITION(X INTEGER, Y INTEGER) RETURN INTEGER IS
BEGIN
return (X + Y);
END;
/
Now, I want to call this function from a program and view the sum. This is how i did it;
DECLARE
q OBJ_NEW;
BEGIN
q := OBJ_NEW (6,3);
q.addition(6,3);
END;
But I am getting this error: "wrong number or types of arguments in call to 'ADDITION'" .. Can you please tell whats wrong in this code?
|