Dynamically Load records to the different tables

kingganesh04

New Member
Hi,

I need one program to load the data from excel to different progress table.

Example:
define temp-table tt_table
fields tt_fields as char extent 15
fields tt_rec_no as integer.

update m_load_table.
/* m_load_table - might be customer or supplier ( or any other table name ) it is a input field */

Repeat:
Input from value (m_file_name).
repeat:
create tt_table
import tt_fields.
assign
tt_rec_no = m_rec_cnt + 1.
end.
input close.
run load_record (m_load_table).
End.

Procedure load_record:
/* Expected coding idea is
1. Load the temp table record to ( m_load_table variable table )

*/
End procedure.
 
And, why are you intentionally trying to do it the hard way?

The code to take a temp-table of char data and apply it to a given table is trivial and very straightforward. Either create a common procedure which reads the input data and creates the temp-table and then call the appropriate sub-program to load the temp-table to the database table or have separate procedures for each table and do the load in a common procedure that all access. You will gain nothing by making it completely dynamic except complexity and obscurity.
 
Back
Top