Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. INSERT from with a loop using MySQL

INSERT from with a loop using MySQL

Scheduled Pinned Locked Moved Database
questionsharepointdatabasemysqlcom
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    Hi, I have employee_benefits MySQL table with the following fields:

    employee_benefit_id --- autonumber
    employee_id
    benefit_category
    benefit_description
    benefit_amount

    I want to loop through all records in the above table and insert the values into salary_slips table which has the following fields:

    salary_slip_id --- autonumber
    document_id ---- forget this it's just UUID
    employee_id -- from employee_id in employee_benefits
    slip_month -- from SP variable param_slip_month
    slip_year -- from SP variable param_slip_year

    and then I want to insert data into salary_slips_details:

    salary_slip_details_id --- autonumber
    salary_slip_id -- the id from salary_slips table
    slip_details_description -- benefit_description from employee_benefits table
    slip_details_amount -- benefit_amount from employee_benefits table

    How can I do this complicated query please? Thanks, Jassim

    Technology News @ www.JassimRahma.com

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups