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 -> Re: Data Normalization & Working with Views

Re: Data Normalization & Working with Views

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 3 Jun 2005 15:24:40 -0800
Message-ID: <42a0d8a8@news.victoria.tc.ca>


Chris (ctaliercio_at_yahoo.com) wrote:
: I'm working with ORacle 10g on HP-UX 11i. I am relatively new to data
: normalization (the previous database I was working with was a complete
: nightmare of replicated information) and working with views, so please
: bear with my ignorance here.

: If you have two tables:

: FIRSTNAME (
: ID INTEGER,
: NAME VARCHAR2(10),
: LASTNAME_ID INTEGER ) -+
: |
: and |
: |
: LASTNAME ( |
: ID INTEGER, -+
: NAME VARCHAR2(10) )

: Where FIRSTNAME has a foreign key relationship established with
: LASTNAME based on ID.

: And you define the following view:

: v_NAMES (
: SELECT
: FIRSTNAME.NAME,
: LASTNAME.NAME
: FROM
: FIRSTNAME, LASTNAME
: WHERE
: FIRSTNAME.LASTNAME_ID = LASTNAME.ID )

: How do you go about inserting new records into the view.

: Suppose I want to put "John Doe" into the view.

INSERT Doe into the last names table. You need to generate an id somehow when you do this.

INSERT John into the first names table, along with the last name id you just created above (you also need to "somehow" generate a first name id).

SELECT from the view - the new name will be there.

--

This space not for rent.
Received on Fri Jun 03 2005 - 18:24:40 CDT

Original text of this message

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