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

Home -> Community -> Usenet -> c.d.o.server -> table update - best way!

table update - best way!

From: Nandakumar <N.Kumar_at_rocketmail.com>
Date: Mon, 23 Aug 1999 18:20:28 GMT
Message-ID: <7ps3cu$eqj$1@nnrp1.deja.com>


Hi

there are two table with identical table structure(field name, field datatype and size are same). One of the fields in tables is DATE_UPD.

i want to populate data from one table to another table based on the DATE_UPD. Process is like,

 1.take a row from first table,

 2.advance the DATE_UPD of the record by 2 days,  ( **the logic here is NOT IMPORTANT**)

 3.check for the existence of the record in the second table   ( record is made of new DATE_UPD with others fields same as in the     first table)

 4a.if record exists in the second table, add one of the fields in the

    first table, say AMOUNT, to the same field of the second table.

 4b) if record does not exist, insert it into the second table.

  i use a cursor to fetch records from the first table.   But it seems, a record of CURSOR%ROWTYPE can't be inserted into a table. I don't want to insert like 'insert into second_table values csr.f1 ...

    csr.f20, as number of fields are many.

  Is there any other way that i can FETCH cursor into a table ( or RECORD), manipulate the date field then insert into the second table? If TABLE could be used, can i use EXISTS or NOT IN clauses with the data rows in TABLE.

i would appreciate your suggestions!
Thanks!
--
Nandakumar
(N.Kumar_at_rocketmail.com)

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Mon Aug 23 1999 - 13:20:28 CDT

Original text of this message

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