title: Writing Dynamic Insert or Update in Oracle
body: <p>I am working on an application that will be used to populate the address details of for employees. The address structure will be different for every country.</p>
  
  <p>For the address style mapping I have a table in which I have mapped all the styles.<br>
  I have the following requirement:</p>
  
  <p>As shown in the image, I have an address mapping table in which<br>
  col1 is for style (wrt country),<br>
  col2 for Field_name (The field to be displayed in front end) and<br>
  col3 for column_field_name (The name of the column in which the field in col2 will be stored in transaction table.)</p>
  
  <pre><code>![Mapping table Desc][1]
  
        **ADDRESS_STYLE  FIELD_NAME       COLUMN_FIELD_NAME**
  
      1   US_GLB  Address Line1                ADDRESS_LINE1
      2   US_GLB  Address Line2                ADDRESS_LINE2
      3   US_GLB  Zip Code                 POSTAL_CODE
      4   US_GLB  Tax Zip Code                 ADD_INFORMATION17
      5   US_GLB  City                         TOWN_OR_CITY
      6   US_GLB  State                        REGION_2
      7   US_GLB  Country                      COUNTRY
      8   US_GLB  Tax Jurisdiction        ADD_INFORMATION15
      9   US_GLB  Tax Jurisdiction Other      ADD_INFORMATION16
      10  US_GLB  Telephone               TELEPHONE_NUMBER_1
      11  US_GLB  Telephone2              TELEPHONE_NUMBER_2
  </code></pre>
  
  <p>Now I have to write a procedure or function which will take the all the in parameters
  and insert those in my transaction table as they are mapped in mapping table.</p>
  
  <p>For Ex-(As shown above)<br>
  Field Address Line1 will be stored in ADDRESS_LINE1  of transaction table.
  Field State will be stored in REGION_2  of transaction table.</p>