• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Batch Insert in db

Participant ,
Jul 14, 2006 Jul 14, 2006

Copy link to clipboard

Copied

i have this script i have been tring to do, but not sure how the 'loop' would work, if anyone could help me please...

say i have 3 tables, for ease i will call them employee, assignment, pay
employee - empid, firstname, lastname, ssn
assignment - assid, payrate
pay - serialID, Batchid, empid, assid, payamount


ok, lets say i have a table (clocks) that has ssn, assid, hoursworked.
it has 1000 records in it. what i want to do is take that clocks table, match the ssn with the employee table to get the empid, match the assid with assignment to get payrate, take the hours times the payrate to get the payamount, and insert that line in the pay table... 'loop' through this until the end... but, one last catch... the batchid is say 200, but, there can only be 100 records per batch, so it must stop at 100 and change the batchID to 201, do another 100 records, change batch to 202 etc...

everything i have tried so far has been a very pathetic attempt. in all honesty this is a clock csv file, which i plan to use coldfusion to dump it into a timesheet table in an informix database. the pay table actually has 85 different fields,. i am confident that once i get this basic loop action done, i can accomplish the rest of this script... any help please?

thnx.
/donrico
TOPICS
Advanced techniques

Views

303

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 14, 2006 Jul 14, 2006

Copy link to clipboard

Copied

The only thing you need a loop for is to load the file into a db table. The rest can be done with sql.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 17, 2006 Jul 17, 2006

Copy link to clipboard

Copied

LATEST
dan,
as i appreciate your comment on my problem, it hasnt moved me foward any. i am still looking for the basic structure of the sql that matches the data and inserts into the db.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation