[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Multiple inserts from one line of file



Hello,

I'm a bit puzzled by a task we have to perform.  A temp table is populated with 
an emplid and there are 20 columns in that table with different earnings codes 
(payroll). Each earning code column could be filled in with an hour amount.  So 
Emplid "1" could have 5hrs in earning code ABC and 3hrs in earning code DEF.  
In fact this employee could have hours in each column.  The trick is that these 
hours are not created on different lines but all on one line and we have to 
insert a record for each earnings code (that has an hour value in it) into the 
a table in Peoplesoft.  Well I select each record from the temp table and store 
them in variables and now I need to do my inserts. I could write 21 different 
insert statements and have an "if earnings_column <> ''" then insert, but I 
think there has to be a less legthy method. I know you will say loop through 
those values in the record and do an insert for each one (meaning only have 
only one insert statement in the program) but how !
would I do this? It would be much easier if the initial table just had emplid, 
earncode, and hours.
Any ideas.
Thanks in advance.