| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Another motivational example for inverse view
Consider
table PolarCoordinates (
theta real,
R real,
)
with constraints R>0, 0<=theta<pi
view CartesianCoordinates
select R*cos(theta) AS x, R*sin(theta) AS y
from PolarCoordinates
This view is clearly updateable, all we need to do is to apply inverse mapping to the any tuple inserted/updated/deleted.
We can even write inverse view explicitly:
view PolarCoordinates
select sqrt(x*x+y*y) AS R, arcsin(y/sqrt(x*x+y*y)) as theta
from PolarCoordinates
Received on Tue Nov 14 2006 - 19:30:54 CST
![]() |
![]() |