Skip to content

Instantly share code, notes, and snippets.

@seychelles111
Last active April 18, 2023 10:00
Show Gist options
  • Save seychelles111/a831cf4ab2e4340ce8e8488085ea31de to your computer and use it in GitHub Desktop.
Save seychelles111/a831cf4ab2e4340ce8e8488085ea31de to your computer and use it in GitHub Desktop.
-- Controller to load data from csv file to CSE_INT_BATCHES_B and TL table.
OPTIONS(ROWS=1)
LOAD DATA
INFILE 'CseAssetBatches.csv'
BADFILE 'CseAssetBatches.bad'
DISCARDFILE 'CseAssetBatches.dsc'
APPEND
INTO TABLE FUSION.CSE_INT_BATCHES_B
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
( INTERFACE_BATCH_CODE
, DUMMYCOL1 FILLER
, DUMMYCOL2 FILLER
, SOURCE_SYSTEM_TYPE "DECODE(:SOURCE_SYSTEM_TYPE, null, 'ORA_INTERNAL', :SOURCE_SYSTEM_TYPE)"
, SOURCE_SYSTEM_CODE "DECODE(:SOURCE_SYSTEM_CODE, null, 'MNT', :SOURCE_SYSTEM_CODE)"
, SOURCE_TRANSACTION_DATE "FUSION.CSE_LOAD_INTERFACE_UTILS_PKG.CONVERT_TIMESTAMP(:SOURCE_TRANSACTION_DATE)"
, ATTRIBUTE_CATEGORY
, ATTRIBUTE_CHAR1
, ATTRIBUTE_CHAR2
, ATTRIBUTE_CHAR3
, ATTRIBUTE_CHAR4
, ATTRIBUTE_CHAR5
, ATTRIBUTE_CHAR6
, ATTRIBUTE_CHAR7
, ATTRIBUTE_CHAR8
, ATTRIBUTE_CHAR9
, ATTRIBUTE_CHAR10
, ATTRIBUTE_CHAR11
, ATTRIBUTE_CHAR12
, ATTRIBUTE_CHAR13
, ATTRIBUTE_CHAR14
, ATTRIBUTE_CHAR15
, ATTRIBUTE_CHAR16
, ATTRIBUTE_CHAR17
, ATTRIBUTE_CHAR18
, ATTRIBUTE_CHAR19
, ATTRIBUTE_CHAR20
, ATTRIBUTE_NUMBER1
, ATTRIBUTE_NUMBER2
, ATTRIBUTE_NUMBER3
, ATTRIBUTE_NUMBER4
, ATTRIBUTE_NUMBER5
, ATTRIBUTE_NUMBER6
, ATTRIBUTE_NUMBER7
, ATTRIBUTE_NUMBER8
, ATTRIBUTE_NUMBER9
, ATTRIBUTE_NUMBER10
, ATTRIBUTE_DATE1 "to_date(:ATTRIBUTE_DATE1, 'YYYY/MM/DD')"
, ATTRIBUTE_DATE2 "to_date(:ATTRIBUTE_DATE2, 'YYYY/MM/DD')"
, ATTRIBUTE_DATE3 "to_date(:ATTRIBUTE_DATE3, 'YYYY/MM/DD')"
, ATTRIBUTE_DATE4 "to_date(:ATTRIBUTE_DATE4, 'YYYY/MM/DD')"
, ATTRIBUTE_DATE5 "to_date(:ATTRIBUTE_DATE5, 'YYYY/MM/DD')"
, ATTRIBUTE_TIMESTAMP1 "FUSION.CSE_LOAD_INTERFACE_UTILS_PKG.CONVERT_TIMESTAMP(:ATTRIBUTE_TIMESTAMP1)"
, ATTRIBUTE_TIMESTAMP2 "FUSION.CSE_LOAD_INTERFACE_UTILS_PKG.CONVERT_TIMESTAMP(:ATTRIBUTE_TIMESTAMP2)"
, ATTRIBUTE_TIMESTAMP3 "FUSION.CSE_LOAD_INTERFACE_UTILS_PKG.CONVERT_TIMESTAMP(:ATTRIBUTE_TIMESTAMP3)"
, ATTRIBUTE_TIMESTAMP4 "FUSION.CSE_LOAD_INTERFACE_UTILS_PKG.CONVERT_TIMESTAMP(:ATTRIBUTE_TIMESTAMP4)"
, ATTRIBUTE_TIMESTAMP5 "FUSION.CSE_LOAD_INTERFACE_UTILS_PKG.CONVERT_TIMESTAMP(:ATTRIBUTE_TIMESTAMP5)"
, CREATED_BY CONSTANT '#CREATEDBY#'
, CREATION_DATE EXPRESSION "SYSTIMESTAMP"
, LAST_UPDATED_BY CONSTANT '#LASTUPDATEDBY#'
, LAST_UPDATE_DATE EXPRESSION "SYSTIMESTAMP"
, LAST_UPDATE_LOGIN CONSTANT '#LASTUPDATELOGIN#'
, OBJECT_VERSION_NUMBER CONSTANT 1
, INTERFACE_BATCH_ID EXPRESSION "FUSION.CSE_INT_S.NEXTVAL"
, INTERFACE_BATCH_STATUS CONSTANT 'READY'
, INTERNAL_BATCH_TYPE CONSTANT 'IB'
, LOAD_REQUEST_ID CONSTANT '#LOADREQUESTID#'
)
INTO TABLE FUSION.CSE_INT_BATCHES_TL
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
( INTERFACE_BATCH_ID POSITION(1) "FUSION.CSE_LOAD_INTERFACE_UTILS_PKG.get_batch_id(:INTERFACE_BATCH_ID)"
, INTERFACE_BATCH_NAME
, INTERFACE_BATCH_DESCRIPTION
, SOURCE_SYSTEM_TYPE FILLER
, SOURCE_SYSTEM_CODE FILLER
, ATTRIBUTE_CATEGORY FILLER
, ATTRIBUTE_CHAR1 FILLER
, ATTRIBUTE_CHAR2 FILLER
, ATTRIBUTE_CHAR3 FILLER
, ATTRIBUTE_CHAR4 FILLER
, ATTRIBUTE_CHAR5 FILLER
, ATTRIBUTE_CHAR6 FILLER
, ATTRIBUTE_CHAR7 FILLER
, ATTRIBUTE_CHAR8 FILLER
, ATTRIBUTE_CHAR9 FILLER
, ATTRIBUTE_CHAR10 FILLER
, ATTRIBUTE_CHAR11 FILLER
, ATTRIBUTE_CHAR12 FILLER
, ATTRIBUTE_CHAR13 FILLER
, ATTRIBUTE_CHAR14 FILLER
, ATTRIBUTE_CHAR15 FILLER
, ATTRIBUTE_CHAR16 FILLER
, ATTRIBUTE_CHAR17 FILLER
, ATTRIBUTE_CHAR18 FILLER
, ATTRIBUTE_CHAR19 FILLER
, ATTRIBUTE_CHAR20 FILLER
, ATTRIBUTE_NUMBER1 FILLER
, ATTRIBUTE_NUMBER2 FILLER
, ATTRIBUTE_NUMBER3 FILLER
, ATTRIBUTE_NUMBER4 FILLER
, ATTRIBUTE_NUMBER5 FILLER
, ATTRIBUTE_NUMBER6 FILLER
, ATTRIBUTE_NUMBER7 FILLER
, ATTRIBUTE_NUMBER8 FILLER
, ATTRIBUTE_NUMBER9 FILLER
, ATTRIBUTE_NUMBER10 FILLER
, ATTRIBUTE_DATE1 FILLER
, ATTRIBUTE_DATE2 FILLER
, ATTRIBUTE_DATE3 FILLER
, ATTRIBUTE_DATE4 FILLER
, ATTRIBUTE_DATE5 FILLER
, ATTRIBUTE_TIMESTAMP1 FILLER
, ATTRIBUTE_TIMESTAMP2 FILLER
, ATTRIBUTE_TIMESTAMP3 FILLER
, ATTRIBUTE_TIMESTAMP4 FILLER
, ATTRIBUTE_TIMESTAMP5 FILLER
, LANGUAGE CONSTANT 'US'
, SOURCE_LANG CONSTANT 'US'
, OBJECT_VERSION_NUMBER CONSTANT 1
, CREATED_BY CONSTANT '#CREATEDBY#'
, CREATION_DATE EXPRESSION "SYSTIMESTAMP"
, LAST_UPDATED_BY CONSTANT '#LASTUPDATEDBY#'
, LAST_UPDATE_DATE EXPRESSION "SYSTIMESTAMP"
, LAST_UPDATE_LOGIN CONSTANT '#LASTUPDATELOGIN#'
, LOAD_REQUEST_ID CONSTANT '#LOADREQUESTID#'
)
-- +=========================================================================+
-- | $Header: fusionapps/scm/doo/bin/DooOrderChargeTiersInt.ctl /st_fusionapps_pt-v2mib/1 2021/03/02 19:28:40 nveluthe Exp $ |
-- +=========================================================================+
-- | Copyright (c) 2014 Oracle Corporation Redwood City, California, USA |
-- | All rights reserved. |
-- |=========================================================================+
-- |
-- | FILENAME
-- | DooOrderChargeTiersInt.ctl
-- |
-- | DESCRIPTION
-- | Uploads CSV file data into DOO_ORDER_CHARGE_TIERS_INT table
-- |
-- | Created by
-- | akpanigr
-- |
-- | History
-- | 01/20/2021 Initial Version
-- |
LOAD DATA LENGTH SEMANTICS CHARACTER
--INFILE 'DooOrderChargeTiersInt.csv'
--BADFILE 'DooOrderChargeTiersInt.bad'
--DISCARDFILE 'DooOrderChargeTiersInt.dsc'
APPEND
INTO TABLE DOO_ORDER_CHARGE_TIERS_INT
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
SOURCE_TRANSACTION_ID CHAR(50),
SOURCE_TRANSACTION_SYSTEM CHAR(30),
SOURCE_TRANSACTION_LINE_ID CHAR(50),
SOURCE_TRANSACTION_SCHEDULE_ID CHAR(50),
SOURCE_CHARGE_ID CHAR(120),
SOURCE_ORDER_CHARGE_TIER_ID CHAR(50),
TIER_SEQUENCE_NUMBER "fun_load_interface_utils_pkg.replace_decimal_char(:TIER_SEQUENCE_NUMBER)",
APPLICATION_METHOD_CODE CHAR(30),
APPLICATION_METHOD CHAR(80),
TIER_FROM "fun_load_interface_utils_pkg.replace_decimal_char(:TIER_FROM)",
TIER_TO "fun_load_interface_utils_pkg.replace_decimal_char(:TIER_TO)",
BLOCK_SIZE "fun_load_interface_utils_pkg.replace_decimal_char(:BLOCK_SIZE)",
ADJUSTMENT_AMOUNT "fun_load_interface_utils_pkg.replace_decimal_char(:ADJUSTMENT_AMOUNT)",
CREATION_DATE expression "systimestamp",
CREATED_BY CONSTANT '#CREATEDBY#',
LAST_UPDATE_DATE expression "systimestamp",
LAST_UPDATED_BY CONSTANT '#LASTUPDATEDBY#',
LAST_UPDATE_LOGIN CONSTANT '#LASTUPDATELOGIN#',
OBJECT_VERSION_NUMBER CONSTANT 1,
LOAD_REQUEST_ID CONSTANT '#LOADREQUESTID#'
)
LOAD DATA
append
INTO TABLE PO_DISTRIBUTIONS_INTERFACE
fields terminated by ',' optionally enclosed by '"' trailing nullcols
(INTERFACE_DISTRIBUTION_ID expression "po_distributions_interface_s.nextval"
,CREATION_DATE expression "current_timestamp(1)"
,LAST_UPDATE_DATE expression "current_timestamp(1)"
,CREATED_BY constant '#CREATEDBY#'
,LAST_UPDATED_BY constant '#LASTUPDATEDBY#'
,LAST_UPDATE_LOGIN constant '#LASTUPDATELOGIN#'
,LOAD_REQUEST_ID constant '#LOADREQUESTID#'
,OBJECT_VERSION_NUMBER constant 1
--,CREATED_BY constant 1
--,LAST_UPDATED_BY constant 1
--,LAST_UPDATE_LOGIN constant 1
--,LOAD_REQUEST_ID constant 1
,INTERFACE_DISTRIBUTION_KEY
,INTERFACE_LINE_LOCATION_KEY
,DISTRIBUTION_NUM
,DELIVER_TO_LOCATION
,DELIVER_TO_PERSON_FULL_NAME char(2000)
,DESTINATION_SUBINVENTORY
,AMOUNT_ORDERED "fun_load_interface_utils_pkg.replace_decimal_char(:AMOUNT_ORDERED)"
,SHIPPING_UOM_QUANTITY "fun_load_interface_utils_pkg.replace_decimal_char(:SHIPPING_UOM_QUANTITY)"
,CHARGE_ACCOUNT_SEGMENT1
,CHARGE_ACCOUNT_SEGMENT2
,CHARGE_ACCOUNT_SEGMENT3
,CHARGE_ACCOUNT_SEGMENT4
,CHARGE_ACCOUNT_SEGMENT5
,CHARGE_ACCOUNT_SEGMENT6
,CHARGE_ACCOUNT_SEGMENT7
,CHARGE_ACCOUNT_SEGMENT8
,CHARGE_ACCOUNT_SEGMENT9
,CHARGE_ACCOUNT_SEGMENT10
,CHARGE_ACCOUNT_SEGMENT11
,CHARGE_ACCOUNT_SEGMENT12
,CHARGE_ACCOUNT_SEGMENT13
,CHARGE_ACCOUNT_SEGMENT14
,CHARGE_ACCOUNT_SEGMENT15
,CHARGE_ACCOUNT_SEGMENT16
,CHARGE_ACCOUNT_SEGMENT17
,CHARGE_ACCOUNT_SEGMENT18
,CHARGE_ACCOUNT_SEGMENT19
,CHARGE_ACCOUNT_SEGMENT20
,CHARGE_ACCOUNT_SEGMENT21
,CHARGE_ACCOUNT_SEGMENT22
,CHARGE_ACCOUNT_SEGMENT23
,CHARGE_ACCOUNT_SEGMENT24
,CHARGE_ACCOUNT_SEGMENT25
,CHARGE_ACCOUNT_SEGMENT26
,CHARGE_ACCOUNT_SEGMENT27
,CHARGE_ACCOUNT_SEGMENT28
,CHARGE_ACCOUNT_SEGMENT29
,CHARGE_ACCOUNT_SEGMENT30
,DESTINATION_CONTEXT
,PROJECT
,TASK
,PJC_EXPENDITURE_ITEM_DATE "to_date(:PJC_EXPENDITURE_ITEM_DATE, 'YYYY/MM/DD')"
,EXPENDITURE
,EXPENDITURE_ORGANIZATION
,PJC_BILLABLE_FLAG
,PJC_CAPITALIZABLE_FLAG
,PJC_WORK_TYPE
,PJC_RESERVED_ATTRIBUTE1
,PJC_RESERVED_ATTRIBUTE2
,PJC_RESERVED_ATTRIBUTE3
,PJC_RESERVED_ATTRIBUTE4
,PJC_RESERVED_ATTRIBUTE5
,PJC_RESERVED_ATTRIBUTE6
,PJC_RESERVED_ATTRIBUTE7
,PJC_RESERVED_ATTRIBUTE8
,PJC_RESERVED_ATTRIBUTE9
,PJC_RESERVED_ATTRIBUTE10
,PJC_USER_DEF_ATTRIBUTE1
,PJC_USER_DEF_ATTRIBUTE2
,PJC_USER_DEF_ATTRIBUTE3
,PJC_USER_DEF_ATTRIBUTE4
,PJC_USER_DEF_ATTRIBUTE5
,PJC_USER_DEF_ATTRIBUTE6
,PJC_USER_DEF_ATTRIBUTE7
,PJC_USER_DEF_ATTRIBUTE8
,PJC_USER_DEF_ATTRIBUTE9
,PJC_USER_DEF_ATTRIBUTE10
,RATE "fun_load_interface_utils_pkg.replace_decimal_char(:RATE)"
,RATE_DATE "to_date(:RATE_DATE, 'YYYY/MM/DD')"
,ATTRIBUTE_CATEGORY
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,ATTRIBUTE16
,ATTRIBUTE17
,ATTRIBUTE18
,ATTRIBUTE19
,ATTRIBUTE20
,ATTRIBUTE_DATE1 "to_date(:ATTRIBUTE_DATE1, 'YYYY/MM/DD')"
,ATTRIBUTE_DATE2 "to_date(:ATTRIBUTE_DATE2, 'YYYY/MM/DD')"
,ATTRIBUTE_DATE3 "to_date(:ATTRIBUTE_DATE3, 'YYYY/MM/DD')"
,ATTRIBUTE_DATE4 "to_date(:ATTRIBUTE_DATE4, 'YYYY/MM/DD')"
,ATTRIBUTE_DATE5 "to_date(:ATTRIBUTE_DATE5, 'YYYY/MM/DD')"
,ATTRIBUTE_DATE6 "to_date(:ATTRIBUTE_DATE6, 'YYYY/MM/DD')"
,ATTRIBUTE_DATE7 "to_date(:ATTRIBUTE_DATE7, 'YYYY/MM/DD')"
,ATTRIBUTE_DATE8 "to_date(:ATTRIBUTE_DATE8, 'YYYY/MM/DD')"
,ATTRIBUTE_DATE9 "to_date(:ATTRIBUTE_DATE9, 'YYYY/MM/DD')"
,ATTRIBUTE_DATE10 "to_date(:ATTRIBUTE_DATE10, 'YYYY/MM/DD')"
,ATTRIBUTE_NUMBER1 "fun_load_interface_utils_pkg.replace_decimal_char(:ATTRIBUTE_NUMBER1)"
,ATTRIBUTE_NUMBER2 "fun_load_interface_utils_pkg.replace_decimal_char(:ATTRIBUTE_NUMBER2)"
,ATTRIBUTE_NUMBER3 "fun_load_interface_utils_pkg.replace_decimal_char(:ATTRIBUTE_NUMBER3)"
,ATTRIBUTE_NUMBER4 "fun_load_interface_utils_pkg.replace_decimal_char(:ATTRIBUTE_NUMBER4)"
,ATTRIBUTE_NUMBER5 "fun_load_interface_utils_pkg.replace_decimal_char(:ATTRIBUTE_NUMBER5)"
,ATTRIBUTE_NUMBER6 "fun_load_interface_utils_pkg.replace_decimal_char(:ATTRIBUTE_NUMBER6)"
,ATTRIBUTE_NUMBER7 "fun_load_interface_utils_pkg.replace_decimal_char(:ATTRIBUTE_NUMBER7)"
,ATTRIBUTE_NUMBER8 "fun_load_interface_utils_pkg.replace_decimal_char(:ATTRIBUTE_NUMBER8)"
,ATTRIBUTE_NUMBER9 "fun_load_interface_utils_pkg.replace_decimal_char(:ATTRIBUTE_NUMBER9)"
,ATTRIBUTE_NUMBER10 "fun_load_interface_utils_pkg.replace_decimal_char(:ATTRIBUTE_NUMBER10)"
,ATTRIBUTE_TIMESTAMP1 "to_timestamp(:ATTRIBUTE_TIMESTAMP1, 'YYYY/MM/DD HH24:MI:SS:FF')"
,ATTRIBUTE_TIMESTAMP2 "to_timestamp(:ATTRIBUTE_TIMESTAMP2, 'YYYY/MM/DD HH24:MI:SS:FF')"
,ATTRIBUTE_TIMESTAMP3 "to_timestamp(:ATTRIBUTE_TIMESTAMP3, 'YYYY/MM/DD HH24:MI:SS:FF')"
,ATTRIBUTE_TIMESTAMP4 "to_timestamp(:ATTRIBUTE_TIMESTAMP4, 'YYYY/MM/DD HH24:MI:SS:FF')"
,ATTRIBUTE_TIMESTAMP5 "to_timestamp(:ATTRIBUTE_TIMESTAMP5, 'YYYY/MM/DD HH24:MI:SS:FF')"
,ATTRIBUTE_TIMESTAMP6 "to_timestamp(:ATTRIBUTE_TIMESTAMP6, 'YYYY/MM/DD HH24:MI:SS:FF')"
,ATTRIBUTE_TIMESTAMP7 "to_timestamp(:ATTRIBUTE_TIMESTAMP7, 'YYYY/MM/DD HH24:MI:SS:FF')"
,ATTRIBUTE_TIMESTAMP8 "to_timestamp(:ATTRIBUTE_TIMESTAMP8, 'YYYY/MM/DD HH24:MI:SS:FF')"
,ATTRIBUTE_TIMESTAMP9 "to_timestamp(:ATTRIBUTE_TIMESTAMP9, 'YYYY/MM/DD HH24:MI:SS:FF')"
,ATTRIBUTE_TIMESTAMP10 "to_timestamp(:ATTRIBUTE_TIMESTAMP10, 'YYYY/MM/DD HH24:MI:SS:FF')"
,DELIVER_TO_PERSON_EMAIL_ADDR
,BUDGET_DATE "to_date(:BUDGET_DATE, 'YYYY/MM/DD')"
,PJC_CONTRACT_NUMBER
,PJC_FUNDING_SOURCE char(360)
,GLOBAL_ATTRIBUTE1 char(150)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment