Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Need help accessing attribute in method

Need help accessing attribute in method

From: Greg <greg_at_yahoo.com>
Date: Mon, 1 Dec 2003 17:21:07 +0000 (UTC)
Message-ID: <bqfta3$7bs$1@sparta.btinternet.com>


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. Received on Mon Dec 01 2003 - 11:21:07 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US