Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Please Help with Cursor Fetch Updating
Hello,
I'm hoping someone can help with a snipit of code for this problem. I can't seem to understand how to post the fetch record based on the tran_code D (Delete) or A(ADD).
Details:
I have a table called mc_dir the key fields in this table are
LastName,FirstName,Number.
On a nightly basis a dbase file is posted(A Transaction file) with the
following fields:
LastName,FirstName,extsn,Tran_code.
this table is called gctemp. I convert the file to ascii and sqlload
into gctemp
I need to compare the tran_code in gctemp and If the trans code is a D delete the record in mc_dir If the trans code is a A add the record in mc_dir
I created a cursor to fetch the records like this:
cursor compare_tables is
select lastname,firstname,number_,TRAN_CODE,uid_
from Mc_Dir MC, gctemp GC
where
UPPER(mc.lastname) = UPPER(gc.last_name) and UPPER(mc.firstname) = UPPER(gc.first_name) and UPPER(mc.number_) = UPPER(gc.extsn) ;
Here is where i get confused and need help
if trans_code is D how do I tell oracle to delete current record from
mc_dir.
or if tran_code is A insert(if not in mc_dir) or update if found.
Any Help would be great.
Thanks alot,
GC
Received on Thu Sep 16 1999 - 22:21:46 CDT
![]() |
![]() |