set echo off
set feedback off
set linesize 1000
set pagesize 0
set sqlprompt ''
set trimspool on
SET TERMOUT OFF
spool SFDC_ASSETS_ENRICH_DATA_PROD.csv
select 'ID' || ',',
'NAME'|| ',',
'ACCOUNT__C'|| ',',
'PARENT_ASSET__C'|| ',',
'PARENT_ASSET__NAME'|| ',',
'SERIAL_NUMBER__C'|| ',',
'PRODUCT__C'|| ',',
'PRODUCT__PRODUCTCODE'|| ',',
'SHIP_DATE__C'|| ',',
'SHIP_TO_CUSTOMER_DATE__C'|| ',',
'REVISION__C'|| ',',
'UPGRADEKEY__C'|| ',',
'OPERATINGSTATUS__C'|| ',',
'ASSETSYSTEM__C'|| ',',
'NOT_FOR_RESALE_ASSET__C'|| ',',
'NFR_START_DATE__C'|| ',',
'NFR_EXPIRATION_DATE__C'|| ',',
'NFR_SOLD_TO_END_CUST__C'|| ',',
'DATE_NFR_ASSET_SOLD_END_CUST_C'|| ',',
'STATUS__C'|| ',',
'ISACTIVE__C'|| ',',
'WARRANTY_ENTIT_ASSET_ID__C'|| ',',
'WARRANTY_ENTIT_ACCOUNTID'|| ',',
'WARRANTY_ENTIT_NAME'|| ',',
'PRODUCT_NAME'|| ',',
'CUSTWARRANTYSTARTDATE__C'|| ',',
'WAR_ENTIT_HW_DURATION_YRS_C'|| ',',
'WAR_ENTIT_WARRANTY_DURATION__C'|| ',',
'WAR_ENTIT_LIMITED_LFTIME_WAR_C'|| ',',
'PRODUCT_WARRANTY_NAME'|| ',',
'LIMITED_OR_LIFETIME_WAR__C'|| ',',
'PROD_WAR_DURATION__C'|| ',',
'PROD_WAR_HW_DURATION_YEARS__C'|| ',',
'ETS_ASSET_PARENT_ID'|| ',',
'UPGRADE_KEY'|| ',',
'MFG_PN'|| ',',
'HW_ASSET_CURRENT_LEVEL'|| ',',
'LICENSE_GENERATED_DATE'|| ',',
'SITE_ID_SFDC'
from dual;
select '"' ||ID || '",' ||
'"' ||NAME || '",' ||
'"' ||ACCOUNT__C || '",' ||
'"' ||PARENT_ASSET__C || '",' ||
'"' ||PARENT_ASSET__NAME || '",' ||
'"' ||SERIAL_NUMBER__C || '",' ||
'"' ||PRODUCT__C || '",' ||
'"' ||PRODUCT__PRODUCTCODE || '",' ||
'"' ||SHIP_DATE__C || '",' ||
'"' ||SHIP_TO_CUSTOMER_DATE__C || '",' ||
'"' ||REVISION__C || '",' ||
'"' ||UPGRADEKEY__C || '",' ||
'"' ||OPERATINGSTATUS__C || '",' ||
'"' ||ASSETSYSTEM__C || '",' ||
'"' ||NOT_FOR_RESALE_ASSET__C || '",' ||
'"' ||NFR_START_DATE__C || '",' ||
'"' ||NFR_EXPIRATION_DATE__C || '",' ||
'"' ||NFR_SOLD_TO_END_CUST__C || '",' ||
'"' ||DATE_NFR_ASSET_SOLD_END_CUST_C || '",' ||
'"' ||STATUS__C || '",' ||
'"' ||ISACTIVE__C || '",' ||
'"' ||WARRANTY_ENTIT_ASSET_ID__C || '",' ||
'"' ||WARRANTY_ENTIT_ACCOUNTID || '",' ||
'"' ||WARRANTY_ENTIT_NAME || '",' ||
'"' ||PRODUCT_NAME || '",' ||
'"' ||CUSTWARRANTYSTARTDATE__C || '",' ||
'"' ||WAR_ENTIT_HW_DURATION_YRS_C || '",' ||
'"' ||WAR_ENTIT_WARRANTY_DURATION__C || '",' ||
'"' ||WAR_ENTIT_LIMITED_LFTIME_WAR_C || '",' ||
'"' ||PRODUCT_WARRANTY_NAME || '",' ||
'"' ||LIMITED_OR_LIFETIME_WAR__C || '",' ||
'"' ||PROD_WAR_DURATION__C || '",' ||
'"' ||PROD_WAR_HW_DURATION_YEARS__C || '",' ||
'"' ||ETS_ASSET_PARENT_ID || '",' ||
'"' ||UPGRADE_KEY || '",' ||
'"' ||MFG_PN || '",' ||
'"' ||HW_ASSET_CURRENT_LEVEL || '",' ||
'"' ||LICENSE_GENERATED_DATE || '",' ||
'"' ||Site_Id_SFDC|| '"'
from tmp_sfdc_assetenrich_prod_mv;
spool off;
exit;
set feedback off
set linesize 1000
set pagesize 0
set sqlprompt ''
set trimspool on
SET TERMOUT OFF
spool SFDC_ASSETS_ENRICH_DATA_PROD.csv
select 'ID' || ',',
'NAME'|| ',',
'ACCOUNT__C'|| ',',
'PARENT_ASSET__C'|| ',',
'PARENT_ASSET__NAME'|| ',',
'SERIAL_NUMBER__C'|| ',',
'PRODUCT__C'|| ',',
'PRODUCT__PRODUCTCODE'|| ',',
'SHIP_DATE__C'|| ',',
'SHIP_TO_CUSTOMER_DATE__C'|| ',',
'REVISION__C'|| ',',
'UPGRADEKEY__C'|| ',',
'OPERATINGSTATUS__C'|| ',',
'ASSETSYSTEM__C'|| ',',
'NOT_FOR_RESALE_ASSET__C'|| ',',
'NFR_START_DATE__C'|| ',',
'NFR_EXPIRATION_DATE__C'|| ',',
'NFR_SOLD_TO_END_CUST__C'|| ',',
'DATE_NFR_ASSET_SOLD_END_CUST_C'|| ',',
'STATUS__C'|| ',',
'ISACTIVE__C'|| ',',
'WARRANTY_ENTIT_ASSET_ID__C'|| ',',
'WARRANTY_ENTIT_ACCOUNTID'|| ',',
'WARRANTY_ENTIT_NAME'|| ',',
'PRODUCT_NAME'|| ',',
'CUSTWARRANTYSTARTDATE__C'|| ',',
'WAR_ENTIT_HW_DURATION_YRS_C'|| ',',
'WAR_ENTIT_WARRANTY_DURATION__C'|| ',',
'WAR_ENTIT_LIMITED_LFTIME_WAR_C'|| ',',
'PRODUCT_WARRANTY_NAME'|| ',',
'LIMITED_OR_LIFETIME_WAR__C'|| ',',
'PROD_WAR_DURATION__C'|| ',',
'PROD_WAR_HW_DURATION_YEARS__C'|| ',',
'ETS_ASSET_PARENT_ID'|| ',',
'UPGRADE_KEY'|| ',',
'MFG_PN'|| ',',
'HW_ASSET_CURRENT_LEVEL'|| ',',
'LICENSE_GENERATED_DATE'|| ',',
'SITE_ID_SFDC'
from dual;
select '"' ||ID || '",' ||
'"' ||NAME || '",' ||
'"' ||ACCOUNT__C || '",' ||
'"' ||PARENT_ASSET__C || '",' ||
'"' ||PARENT_ASSET__NAME || '",' ||
'"' ||SERIAL_NUMBER__C || '",' ||
'"' ||PRODUCT__C || '",' ||
'"' ||PRODUCT__PRODUCTCODE || '",' ||
'"' ||SHIP_DATE__C || '",' ||
'"' ||SHIP_TO_CUSTOMER_DATE__C || '",' ||
'"' ||REVISION__C || '",' ||
'"' ||UPGRADEKEY__C || '",' ||
'"' ||OPERATINGSTATUS__C || '",' ||
'"' ||ASSETSYSTEM__C || '",' ||
'"' ||NOT_FOR_RESALE_ASSET__C || '",' ||
'"' ||NFR_START_DATE__C || '",' ||
'"' ||NFR_EXPIRATION_DATE__C || '",' ||
'"' ||NFR_SOLD_TO_END_CUST__C || '",' ||
'"' ||DATE_NFR_ASSET_SOLD_END_CUST_C || '",' ||
'"' ||STATUS__C || '",' ||
'"' ||ISACTIVE__C || '",' ||
'"' ||WARRANTY_ENTIT_ASSET_ID__C || '",' ||
'"' ||WARRANTY_ENTIT_ACCOUNTID || '",' ||
'"' ||WARRANTY_ENTIT_NAME || '",' ||
'"' ||PRODUCT_NAME || '",' ||
'"' ||CUSTWARRANTYSTARTDATE__C || '",' ||
'"' ||WAR_ENTIT_HW_DURATION_YRS_C || '",' ||
'"' ||WAR_ENTIT_WARRANTY_DURATION__C || '",' ||
'"' ||WAR_ENTIT_LIMITED_LFTIME_WAR_C || '",' ||
'"' ||PRODUCT_WARRANTY_NAME || '",' ||
'"' ||LIMITED_OR_LIFETIME_WAR__C || '",' ||
'"' ||PROD_WAR_DURATION__C || '",' ||
'"' ||PROD_WAR_HW_DURATION_YEARS__C || '",' ||
'"' ||ETS_ASSET_PARENT_ID || '",' ||
'"' ||UPGRADE_KEY || '",' ||
'"' ||MFG_PN || '",' ||
'"' ||HW_ASSET_CURRENT_LEVEL || '",' ||
'"' ||LICENSE_GENERATED_DATE || '",' ||
'"' ||Site_Id_SFDC|| '"'
from tmp_sfdc_assetenrich_prod_mv;
spool off;
exit;