replace INTO <@TABLENAME@> (value_id,
entity_type_id,
attribute_id,
store_id,
entity_id,
value
) VALUES 
(NULL,
(  SELECT b.entity_type_id from eav_entity_type b
where  b.entity_table = '<@ATTRIBTYPE@>')
,
(
SELECT c.attribute_id from eav_entity_type b
JOIN eav_attribute c ON c.entity_type_id = b.entity_type_id
WHERE b.entity_table = '<@ATTRIBTYPE@>' and c.attribute_code = '<@ATTRIBNAME@>'
)

,1, <@KEY@>,
(
SELECT IF('<@COLVALUE@>'='',c.default_value,'<@COLVALUE@>') from eav_entity_type b
JOIN eav_attribute c ON c.entity_type_id = b.entity_type_id
WHERE b.entity_table = '<@ATTRIBTYPE@>' and c.attribute_code = '<@ATTRIBNAME@>'
)

  )