# -*- coding: utf-8 -*-
#
# This file is part of the "e-PRTR P-Modul Datenbank Generator".
# For more information, see the release information on main.en.rb. 
#
# Diese Datei ist Teil des "e-PRTR P-Modul Datenbank Generator".
# Fuer weitere Informationen und Release-Informationen siehe mein.en.rb.
#

class Taet < Entry
#  @@initialized = false
  def initialize(row, gk_table)
    super(row,gk_table)

  end

  def write_out()
    $db_target.execute("INSERT INTO activities (
      id,
      facility_id,
      year,
      main_activity,
      prtr_key,
      prtr_description,
      ippc_key,
      ippc_description,
      business_sector
      ) VALUES (
      #{sqlize('id')},
      #{sqlize('p_betrieb_id')},
      #{sqlize('jahr')},
      #{sqlize('htprtr')},
      #{sqlize('prtr_schl')},
      #{sqlize('prtr_text')},
      #{sqlize('ivu_schl')},
      #{sqlize('ivu_text')},
      #{sqlize('name')}
      )")
    @geheimk.each do |gk|
      $db_target.execute("INSERT INTO activities_pdcc (activity_id, reason) VALUES (#{@data['id']},'#{gk[1]}')")
    end

  end


end
