script to bulk load csv file data to table when different but depends on csv data [message #195597] |
Fri, 29 September 2006 10:32 |
abhijion
Messages: 9 Registered: May 2006
|
Junior Member |
|
|
hi,
i need to load data from an excel sheet into a table which is in the folllowing column format:---
industry_group
industry_sector
industry_vertical
department
role
1 industry group has n sectors..each sector has n verticals n so on.
the catch is that corresponding table
called classification has structure like :--
[classification_id]
,[classification_sobject_id]
,[classification_name]
,[parent_id]
,[object_level]
,[is_active]
,[level_name]
this table is in object oriented format so that the parent table S_object stores object_id and parent_id of all the levels of classification.
i.e. say industry group is level 1 has object_id 1 and parent_id 0.
vertical is level 2 has object_id values(2,3,4,5,6) corresponding to different industry groups and parent_id 2.
now i need to write a script that should be reusable if number of levels increases, (say company_type under sector level) , and load corresponding values in table .
assume that I have made an entry in s_object table for new level added .(for each level in excelsheet there is an entry in s_object )
now all these values in excel sheet will go into classification_name column of classification table and parent_id and classification_sobject_id should be from s_object table.
any idea how to write a script that can be used dynamically to do this job.
if you need i may provide sample data from s_object,classification tables and excel sheet .
all clarifications are welcome.
|
|
|
|
|