INSERT INTO cataloginventory_stock_item (
item_id,
product_id,
stock_id,
qty,
min_qty,
use_config_min_qty,
is_qty_decimal,
backorders,
use_config_backorders,
min_sale_qty,
use_config_min_sale_qty,
max_sale_qty,
use_config_max_sale_qty,
is_in_stock,
low_stock_date,
notify_stock_qty,
use_config_notify_stock_qty,
manage_stock,
use_config_manage_stock,
stock_status_changed_auto,
use_config_qty_increments,
qty_increments,
use_config_enable_qty_inc,
enable_qty_increments
) VALUES (
NULL, 
<@KEY@>,
1,
<@NEWFQTYONHAND@> / <@UNITQTY@>,
'0',
1,
0,
0,
1,
'1',
1,
'0',
1,
1,
now(),
NULL,
1,
0,
1,
1,
1,
'0',
1,
0
);
@@GO@@
replace INTO cataloginventory_stock_status (
product_id,
website_id,
stock_id,
qty,
stock_status
) VALUES (
<@KEY@>,
1,
1,
<@NEWFQTYONHAND@> / <@UNITQTY@>,
1);
@@GO@@
replace  INTO catalogsearch_fulltext (
fulltext_id,
product_id,
store_id,
data_index
) VALUES (
NULL,
<@KEY@>,
1,
CONCAT('<@SSTOCKCODE@>',
    '|Enabled|',
    'Taxable Goods',
    '|',
    '<@SDESCRIPTION@>',
    '|',
    '<@SDESCRIPTION@>',
    '|',
    '<@SDESCRIPTION@>',
    '|',
    '<@FSELLINGPRICE1@>',
    '|0')
);
@@GO@@

replace INTO `catalog_product_index_price` (`entity_id`, `customer_group_id`, `website_id`, `tax_class_id`, `price`, `final_price`, `min_price`, `max_price`, `tier_price`) VALUES 
(<@KEY@>, 0, 1, 1, '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', NULL),
(<@KEY@>, 1, 1, 1, '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', NULL),
(<@KEY@>, 2, 1, 1, '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', NULL),
(<@KEY@>, 3, 1, 1, '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', '<@FSELLINGPRICE1@>', NULL);
@@GO@@
INSERT INTO catalog_product_website (
product_id,
website_id
) VALUES (
<@KEY@>,
1
);
@@GO@@
replace  INTO core_url_rewrite (
url_rewrite_id,
store_id,
id_path,
request_path,
target_path,
is_system,
options,
description,
category_id,
product_id
) VALUES (
NULL,
1,
CONCAT('product/',<@KEY@>),
REPLACE(CONCAT('<@SDESCRIPTION@>','.html'),' ','-'),
CONCAT('catalog/product/view/id/',<@KEY@>),
1,
NULL,
NULL,
<@PROCESS@>@select substring(IMP_EXTID from 6 for 12) from IMP_LINK where WGROUPID = <@WREPORTINGGROUP1ID@> and imp_sourceid =<@SOURCEID@> ##,
<@KEY@>);
@@GO@@ 
INSERT INTO index_event (
event_id,
type,
entity,
entity_pk,
created_at,
old_data,
new_data
) VALUES (
NULL,
'save',
'cataloginventory_stock_item',
<@KEY@>,
now(),
NULL,
'a:6:{s:35:"cataloginventory_stock_match_result";b:1;s:34:"catalog_product_price_match_result";b:0;s:24:"catalog_url_match_result";b:0;s:33:"catalog_product_flat_match_result";b:0;s:37:"catalog_category_product_match_result";b:0;s:35:"catalogsearch_fulltext_match_result";b:0;}'),
(
NULL,
'save',
'catalog_product',
<@KEY@>,
now(),
NULL,
'a:6:{s:35:"cataloginventory_stock_match_result";b:1;s:34:"catalog_product_price_match_result";b:1;s:24:"catalog_url_match_result";b:1;s:33:"catalog_product_flat_match_result";b:1;s:37:"catalog_category_product_match_result";b:1;s:35:"catalogsearch_fulltext_match_result";b:1;}'),
( NULL,
'catalog_reindex_price',
'catalog_product',
<@KEY@>,
now(),
NULL,
'a:6:{s:35:"cataloginventory_stock_match_result";b:0;s:34:"catalog_product_price_match_result";b:1;s:24:"catalog_url_match_result";b:0;s:33:"catalog_product_flat_match_result";b:0;s:37:"catalog_category_product_match_result";b:0;s:35:"catalogsearch_fulltext_match_result";b:0;}'
);
@@GO@@