Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> INCREMENTAL DATA EXTRACTS FROM TABLES
Hi everyone,
PROBLEM:
I have 2 tables. Parent table and child table with a 1-m relationship.
ORDERS cust_cd key-1 order_date key-2 update_date ( date on which inserted/updated ) ORDER_DETAILS cust_cd key-1 order_date key-2 line_no key-3 update_date ( date on which inserted/updated )
I have a Pro*C program which downloads data into a particular format from both these tables.
I need to pull out data from parent and child tables which have changed since the last download process.
I cannot use export or sqlloader since there are a lot of formatting
gimmicks
and some minor logic which the Pro*C program does.
2 SOLUTIONS I HAVE THOUGHT OF:
Have a trigger on ORDERS and ORDER_DETAILS table which fire and populate
a third table EVENT_LOGGER with keys from ORDER and ORDER_DETAILS.
Have a Pro*C process which pulls out keys from event-logger , goes against the ORDERS and ORDER_DETAILS and produces the flat file. Cons
----
a) Overhead on trigger getting fired 2. Solution-2
----------
Everytime the download is done store the date somewhere and compare it with UPDATE_DATE of each row before deciding whether to write to flat file. Cons
----
a) Deleted cant be recorded. MY QUESTION [ at last :-) ]
I would very much appreciate any help from all ye netters.
Thanks for your time.
regards,
Jude.
-------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to UsenetReceived on Tue Jun 17 1997 - 00:00:00 CDT
![]() |
![]() |