Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Natural or Description Keys in SO_LINES_ALL

Status
Not open for further replies.

gk4u

Programmer
Jul 2, 2002
21
IN
Hi,
I am going to write a script to load SO_LINES_ALL/SO_HEADERS_ALL data from 10.7 to 11i. As there are lots of IDs in the table and we have to create new ids in the target system.
I need help how to find the natural/descrptive key corrosponding to these Id's so that I can derive new Ids in the target system with the help of natural/descriptive fields.

TIA
GK
 
Check for unique indexes (indices for purists): SO_HEADERS_ALL.SO_HEADERS_U2(Order_Number, Order_Type_ID). For SO_LINES_ALL, you'd have Header_ID plus Line_Number.

But why can't you use the existing header_id as a unique key going in and replace it with the new id?
 
Hi Mdwyer,
Thanks, you are right. But in the SO_LINES_ALL there are lots of ID's like SHIPMENT_SCHEDULE_LINE_ID
PARENT_LINE_ID,ATO_LINE_ID etc. we can not go straight forward and indsert this into target system. Our stretegy is first we extract the natural key corrosponding to the ID from the legacy system and we will find the new ID corrrosponding to the extracted natural keyt in the target system.
For example:-
ORG_ID
Extract:- (From Lecacy system)
Select name Into v_org_name
From hr_all_organization_units
Where organization_id = p_org_id;


Conversion:- (Into target system)
Select organization_id Into v_ org_id
From hr_all_organization_units
Where name = v_org_name;

After getting all the natural keys from the legacy system we will insert new IDs in to the target system.

I Hope this is clear now. I would appriciate if you give me some advice on this


Regards,
GK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top