Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Need help accessing attribute in method



I am trying to build a simple object-relational DB based on an air traffic
control system. I am going to have object tables for plane and runway with a
relation table called flight_info which will contain pointers to the other 2
tables so that I can planes to runways.

 I am trying to create a method for the plane table that will calculate the
stopping distance of a plane based on various parameters. One of these
parameters is the number of passengers on a particular flight which is
stored in the flight_info table. I'm not sure if I can access this attribute
but would like to ask if I can or what my options are regarding this.

 Here is what I have written so far for my method (the
no_of_passengers_on_flight is what I want to access which is in the
flight_info relational table):

MEMBER FUNCTION getStopDist RETURN NUMBER IS
DECLARE
weight1 number;
stopdist1 number;
stopdist2 number;
stopdist3 number;
BEGIN
weight1 := ((no_of_passengers_on_flight * 70) + SELF.cargo_loading +
SELF.fuel_loading);

 IF SELF.bhp = 350 THEN
  stopdist1 := 0.25;
 ELSIF SELF.bhp = 5000 THEN
  stopdist1 := 0.5;
 ELSE
  stopdist1 := 0.7;
 END IF;

 IF SELF.engine_capacity = 500 THEN
  stopdist2 := 0.7;
 ELSIF SELF.engine_capacity = 600 THEN
  stopdist2 := 0.8;
 ELSE
  stopdist := 0.9;
 END IF;

 IF SELF.model = 747 THEN
  stopdist3 := 0.5;
 ELSIF SELF.model = 343 THEN
  stopdist3 := 0.4;
 ELSE
  stopdist3:= 0.6;
 END IF;

RETURN (weight1 || stopdist1 || stopdist2 || stopdist3);
END;

Any help with this would be great.





<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.