Re: Please help with Inserting ID into table from another table in Oracle 9.2



MrHelpMe wrote:

Why two procedures and not one?
--
Daniel A. Morgan
University of Washington
damor...@xxxxxxxxxxxxxxxx
(replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text -

- Show quoted text -

Hi DA Morgan,
Thanks for the reply. I used 2 procedures originally because I wasn't
sure how to accomplish this in 1 procedure. To be honest I just
managed to figure this out and it looks like it is definitely working
now, however, I need your assistance and ask you and other experts
what I can do in the below situation.

Now that I have the insert working, how can I say the following. Upon
insert if the FirstName, LastName and Email address are the same do
not insert into the Users table but insert into the other 2 tables all
the info. plus the appropriate user id.

What you are asking is unclear but look at the Merge Statement if the
choice in a single table is insert/update. Look at the INSERT FIRST,
INSERT ALL, and INSERT WHEN statements.

Also consider doing a SELECT COUNT(*) to determine if the record has
already been inserted.

You can find all of these in Morgan's Library at www.psoug.org.
Look up MERGE and INSERT.
--
Daniel A. Morgan
University of Washington
damorgan@xxxxxxxxxxxxxxxx
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
.



Relevant Pages

  • Re: Slow SQL, too many logical reads ?
    ... Daniel A. Morgan ... University of Washington ... Puget Sound Oracle Users Groupwww.psoug.org ...
    (comp.databases.oracle.server)
  • Re: display a boolean variable?
    ... Daniel A. Morgan ... University of Washington ... Puget Sound Oracle Users Groupwww.psoug.org ...
    (comp.databases.oracle.misc)
  • Re: - How to ?
    ... Daniel A. Morgan ... University of Washington ... Puget Sound Oracle Users Groupwww.psoug.org ...
    (comp.databases.oracle.server)
  • Re: Big doubt...
    ... Daniel A. Morgan ... University of Washington ... Puget Sound Oracle Users Groupwww.psoug.org ...
    (comp.databases.oracle.server)
  • Re: Comparison of Oracle commans Vs. SQL Server Commands
    ... Daniel A. Morgan ... University of Washington ... Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text - ...
    (comp.databases.oracle.server)