How Do u Declare a boolean?

kstyle

Member
Hi there,

This is real basic question but for some reason i am having some real problems with it. I have the following code, and when i run it, it comes with the folowing error:

Code snippit:

create or replace type Line_c01ksp as object (
y1 number,
y2 number,
y3 number,
y4 number,

x1 number,
x2 number,
x3 number,
x4 number,

a1 number,
a2 number,
b1 number,
b2 number,
c1 number,

xc number,
yc number,

num number,
denom number,

r1 number,
r2 number,
r3 number,
r4 number,

asign boolean,
bsign boolean,

member function getStart return Pnt_c01ksp,
member function getFinish return Pnt_c01ksp,
member function intersectsLL(l1 Line_c01ksp, l2 line_c01ksp) return CrossOverResult_c01ksp
)
/

ERRoR MESSAGE:

29/7 PLS-00530: Illegal type used for object type attribute:
'BOOLEAN'.

30/7 PLS-00530: Illegal type used for object type attribute:
'BOOLEAN'.

could some please tell me wot im doin wrong???

Thank you for your time.

kstyle.
 
First of all, you posted this question 4 times ;)
A database type can only hold database type variables. So you can use Varchar2, Number etc. But you can't use any PL/SQL Types, like Boolean, PLS_Integer etc.

Hope this helps,
Patrick
 
Originally posted by kstyle:
Hi there,

This is real basic question but for some reason i am having some real problems with it. I have the following code, and when i run it, it comes with the folowing error:

Code snippit:

create or replace type Line_c01ksp as object (
y1 number,
y2 number,
y3 number,
y4 number,

x1 number,
x2 number,
x3 number,
x4 number,

a1 number,
a2 number,
b1 number,
b2 number,
c1 number,

xc number,
yc number,

num number,
denom number,

r1 number,
r2 number,
r3 number,
r4 number,

asign boolean,
bsign boolean,

member function getStart return Pnt_c01ksp,
member function getFinish return Pnt_c01ksp,
member function intersectsLL(l1 Line_c01ksp, l2 line_c01ksp) return CrossOverResult_c01ksp
)
/

ERRoR MESSAGE:

29/7 PLS-00530: Illegal type used for object type attribute:
'BOOLEAN'.

30/7 PLS-00530: Illegal type used for object type attribute:
'BOOLEAN'.

could some please tell me wot im doin wrong???

Thank you for your time.

kstyle.
The reason for this unlucky bejavior is that oracle implemented the OO Feature not in PL/SQL but in SQL ( Two execution engines );
and put a little bit PL/SQL arround it for methods;
But you can define a Method which return true /false depending on a number -val of a data member 0/1

Carl
 
Back
Top