PPT Slide
Example: DB2 UDB/OSF White Box ADT
- Point as a "white box ADT" (written in SQL3)
create function distance(p1 Point, p2 Point) returns Point
language SQL inline not variant
return sqrt((p2..y-p1..y)*(p2..y-p1..y) + (p2..x-p1..x)*(p2..x-p1..x));
where C.name = 'San Jose'
and distance(E.location, C.center) < 25;