Re: [HELP]: SQL code assistance
Date: Wed, 13 Oct 1993 14:27:24 GMT
Message-ID: <1993Oct13.142724.13649_at_KYnug.org>
In article <29g4ks$jb2_at_crcnis1.unl.edu> nolan_at_helios.unl.edu (Michael
Nolan) writes:
> Neil Greene <neil_at_kynug.org> writes:
>
> >As a new Oracle sql writer, I was wondering if someone could pass along
to
> >me some sample code that will take a selection of multiple records and
> >process them one at a time.
> >I have Social Security numbers in two tables, TABLE-A and TABLE-B. I
> >would like to scan the records in TABLE-B to a match in TABLE-A. Based
on
> >the result, I would like to do some processing, like: if match do this,
if
> >no match, add a new record.
>
> Do you really want to this in SQL (ie, SQL*PLUS) or in PL*SQL? (The
latter
> has many more language features, although no reporting capabilities.)
>
> Before developing some example code, you may need to analyze your
situation
> a bit more. As I see it, you have 3 possibilies:
>
> X exists in Table B, but not in Table A.
> X exists in both Table A and Table B.
> X exists in Table A, but not in Table B. (Or is this unimportant?)
>
> Also, is it possible for there to be multiple occurrences of X in either
> Table A or B?
>
> Lastly, is the order in which rows are processed significant?
PL*SQL would be of the tool of choice.
Here are the details:
I have a table, we will call this table TABLE-B. This table has records consisting of fname, mname, lname, ss number, id, issuedate, expiredate, licensenumber. The master table is TABLE-A, which is in the same format.
I need to scan the records in TABLE-B in an effort to find out where TABLE-B:SS = TABLE-A:SS. If there is a match, I need to do something, if there is no match, I need to do something else.
-- Neil Greene President, benchMark Developments, Inc. [NeXT VAR] President, Kentucky NeXT User Group, Inc. North American, TIFFany DistributorReceived on Wed Oct 13 1993 - 15:27:24 CET
