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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Insert with a relationship...

Re: Insert with a relationship...

From: Bob Fazio <rfazio_at_home.com.nospam>
Date: 2000/05/31
Message-ID: <8DYY4.224338$Tn4.1963848@news1.rdc2.pa.home.com>#1/1

All assumptions are correct about relationships, but in order for anything to automatically update the address with the correct field, someone has to code the correct insert statement into the address table. If you are using something like Oracle forms to create the screen, then maybe (I don't use Oracle forms). But for anyone to answer this question, we will need to know what tool you are using.

--
Robert Fazio, Oracle DBA
rfazio_at_home.com
remove nospam from reply address
http://24.8.218.197/
"GAB" <news4_at_REMOVEbaxnet.net> wrote in message
news:MPG.139e1af3c3a43a51989690_at_news.usenetserver.com...

> I'm new to this - so here goes.
>
> Table STATE is the "one" (on the one side of the one-many relationship),
> with pri key column 'PK_State_ID'. Cool. Table ADDRESS is the "many",
> with foreign key column 'FK_State_ID' referring back to 'PK_State_ID'.
> STATE --> ADDR
>
> Am I even close with the following assumptions: ?
> 1) Make a user screen with all the Address info, have them fill it in.
> 2) When they get to the "State" field, use a drop-down and force them to
> find a valid State. (BTW - Georgia is not a valid state of any kind,
> neither is Alabama for that matter lol).
> 3) If "State" does not exist, pop up another screen to add correct
> state. Insert it. Now it should show up in #2.
> 3) Now I've got enough info to insert an ADDR record I guess.
>
> Here's my big puzzling question:
>
> If I fill in the SQL statement with all the ADDR data from my screen,
> will it then AUTOMATICALLY fill in the STATE field somehow since I've
> ensured the FK/PK constraint in ADDR? Or do I have to do manually add
> it to the insert statment, something like "insert into ADDR (street,
> city, stateid) values (screen.street, screen.city, STATE.ID)".
>
> In other words, how much is storage/retrieval is done for you during
> either the SELECT or INSERT due to the fact the constraint exists?
>
> I know this is awfully basic - sorry in advance
>
> Alex
>
>
>
Received on Wed May 31 2000 - 00:00:00 CDT

Original text of this message

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