You are on page 1of 5

SELECT a.RECID, a.XMLRECORD "THE_RECORD",a.

RECID "PROPERTY_NAME"
,extractValue(a.XMLRECORD,'/row/c1[position()=1]') "FROM_DATE"
,extract(a.XMLRECORD,'/row/c1') "FROM_DATE_1"
,extractValue(a.XMLRECORD,'/row/c2[position()=1]') "TO_DATE"
,extract(a.XMLRECORD,'/row/c2') "TO_DATE_2"
,extractValue(a.XMLRECORD,'/row/c3[position()=1]') "DAYS"
,extract(a.XMLRECORD,'/row/c3') "DAYS_3"
,extractValue(a.XMLRECORD,'/row/c4[position()=1]') "BALANCE"
,extract(a.XMLRECORD,'/row/c4') "BALANCE_4"
,extractValue(a.XMLRECORD,'/row/c5[position()=1]') "BASIS"
,extract(a.XMLRECORD,'/row/c5') "BASIS_5"
,extractValue(a.XMLRECORD,'/row/c6[position()=1]') "RATE"
,extract(a.XMLRECORD,'/row/c6') "RATE_6"
,extractValue(a.XMLRECORD,'/row/c7[position()=1]') "MARGIN"
,extract(a.XMLRECORD,'/row/c7') "MARGIN_7"
,extractValue(a.XMLRECORD,'/row/c8[position()=1]') "ACCRUAL_AMT"
,extract(a.XMLRECORD,'/row/c8') "ACCRUAL_AMT_8"
,extractValue(a.XMLRECORD,'/row/c9[position()=1]') "ACT_ACC_AMT"
,extract(a.XMLRECORD,'/row/c9') "ACT_ACC_AMT_9"
,extractValue(a.XMLRECORD,'/row/c10[position()=1]') "COMPOUND_FQU"
,extract(a.XMLRECORD,'/row/c10') "COMPOUND_FQU_10"
,extractValue(a.XMLRECORD,'/row/c11[position()=1]') "COMPOUND_YIELD"
,extract(a.XMLRECORD,'/row/c11') "COMPOUND_YIELD_11"
,extractValue(a.XMLRECORD,'/row/c12[position()=1]') "LAST_ARCHIVE_DATE"
,extractValue(a.XMLRECORD,'/row/c13[position()=1]') "PERIOD_START"
,extract(a.XMLRECORD,'/row/c13') "PERIOD_START_13"
,extractValue(a.XMLRECORD,'/row/c14[position()=1]') "PERIOD_END"
,extract(a.XMLRECORD,'/row/c14') "PERIOD_END_14"
,extractValue(a.XMLRECORD,'/row/c15[position()=1]') "TOT_ACCR_AMT"
,extract(a.XMLRECORD,'/row/c15') "TOT_ACCR_AMT_15"
,extractValue(a.XMLRECORD,'/row/c16[position()=1]') "TOT_SUSP_AMT"
,extract(a.XMLRECORD,'/row/c16') "TOT_SUSP_AMT_16"
,extractValue(a.XMLRECORD,'/row/c17[position()=1]') "TOT_DUE_AMT"
,extract(a.XMLRECORD,'/row/c17') "TOT_DUE_AMT_17"
,extractValue(a.XMLRECORD,'/row/c18[position()=1]') "TOT_RPY_AMT"
,extract(a.XMLRECORD,'/row/c18') "TOT_RPY_AMT_18"
,extractValue(a.XMLRECORD,'/row/c19[position()=1]') "ADJUST_INT_AMT"
,extract(a.XMLRECORD,'/row/c19') "ADJUST_INT_AMT_19"
,extractValue(a.XMLRECORD,'/row/c20[position()=1]') "TOT_RES_AMT"
,extract(a.XMLRECORD,'/row/c20') "TOT_RES_AMT_20"
,extractValue(a.XMLRECORD,'/row/c21[position()=1]') "TOT_POS_ACCR_AMT"
,extract(a.XMLRECORD,'/row/c21') "TOT_POS_ACCR_AMT_21"
,extractValue(a.XMLRECORD,'/row/c22[position()=1]') "TOT_NEG_ACCR_AMT"
,extract(a.XMLRECORD,'/row/c22') "TOT_NEG_ACCR_AMT_22"
,extractValue(a.XMLRECORD,'/row/c23[position()=1]') "INT_EFF_DATE"
,extract(a.XMLRECORD,'/row/c23') "INT_EFF_DATE_23"
,extractValue(a.XMLRECORD,'/row/c24[position()=1]') "FLOATING_INDEX"
,extract(a.XMLRECORD,'/row/c24') "FLOATING_INDEX_24"
,extractValue(a.XMLRECORD,'/row/c25[position()=1]') "PERIODIC_INDEX"
,extract(a.XMLRECORD,'/row/c25') "PERIODIC_INDEX_25"
,extractValue(a.XMLRECORD,'/row/c26[position()=1]') "ALTERNATE_INTEREST"
,extractValue(a.XMLRECORD,'/row/c27[position()=1]') "LINK_EFF_DATE"
,extract(a.XMLRECORD,'/row/c27') "LINK_EFF_DATE_27"
,extractValue(a.XMLRECORD,'/row/c28[position()=1]') "LINKED_ARRANGEMENT"
,extract(a.XMLRECORD,'/row/c28') "LINKED_ARRANGEMENT_28"
,extractValue(a.XMLRECORD,'/row/c29[position()=1]') "LINKED_PROPERTY"
,extract(a.XMLRECORD,'/row/c29') "LINKED_PROPERTY_29"
,extractValue(a.XMLRECORD,'/row/c30[position()=1]') "LINKED_BALANCE_TYPE"
,extract(a.XMLRECORD,'/row/c30') "LINKED_BALANCE_TYPE_30"
,extractValue(a.XMLRECORD,'/row/c31[position()=1]') "LINKED_SOURCE_CALC_TYPE"
,extract(a.XMLRECORD,'/row/c31') "LINKED_SOURCE_CALC_TYPE_31"
,extractValue(a.XMLRECORD,'/row/c32[position()=1]') "MAX_OFF_SET"
,extract(a.XMLRECORD,'/row/c32') "MAX_OFF_SET_32"
,extractValue(a.XMLRECORD,'/row/c33[position()=1]') "FIXED_INT_AMT"
,extract(a.XMLRECORD,'/row/c33') "FIXED_INT_AMT_33"
,extractValue(a.XMLRECORD,'/row/c34[position()=1]') "PAYMENT_MODE"
,extractValue(a.XMLRECORD,'/row/c35[position()=1]') "INFO_FROM_DATE"
,extract(a.XMLRECORD,'/row/c35') "INFO_FROM_DATE_35"
,extractValue(a.XMLRECORD,'/row/c36[position()=1]') "INFO_TO_DATE"
,extract(a.XMLRECORD,'/row/c36') "INFO_TO_DATE_36"
,extractValue(a.XMLRECORD,'/row/c37[position()=1]') "INFO_DAYS"
,extract(a.XMLRECORD,'/row/c37') "INFO_DAYS_37"
,extractValue(a.XMLRECORD,'/row/c38[position()=1]') "INFO_BALANCE"
,extract(a.XMLRECORD,'/row/c38') "INFO_BALANCE_38"
,extractValue(a.XMLRECORD,'/row/c39[position()=1]') "INFO_BASIS"
,extract(a.XMLRECORD,'/row/c39') "INFO_BASIS_39"
,extractValue(a.XMLRECORD,'/row/c40[position()=1]') "INFO_RATE"
,extract(a.XMLRECORD,'/row/c40') "INFO_RATE_40"
,extractValue(a.XMLRECORD,'/row/c41[position()=1]') "INFO_MARGIN"
,extract(a.XMLRECORD,'/row/c41') "INFO_MARGIN_41"
,extractValue(a.XMLRECORD,'/row/c42[position()=1]') "INFO_ACCRUAL_AMT"
,extract(a.XMLRECORD,'/row/c42') "INFO_ACCRUAL_AMT_42"
,extractValue(a.XMLRECORD,'/row/c43[position()=1]') "INFO_ACT_ACC_AMT"
,extract(a.XMLRECORD,'/row/c43') "INFO_ACT_ACC_AMT_43"
,extractValue(a.XMLRECORD,'/row/c44[position()=1]') "INFO_COMPOUND_FQU"
,extract(a.XMLRECORD,'/row/c44') "INFO_COMPOUND_FQU_44"
,extractValue(a.XMLRECORD,'/row/c45[position()=1]') "INFO_COMPOUND_YIELD"
,extract(a.XMLRECORD,'/row/c45') "INFO_COMPOUND_YIELD_45"
,extractValue(a.XMLRECORD,'/row/c46[position()=1]') "INFO_PERIOD_START"
,extract(a.XMLRECORD,'/row/c46') "INFO_PERIOD_START_46"
,extractValue(a.XMLRECORD,'/row/c47[position()=1]') "INFO_PERIOD_END"
,extract(a.XMLRECORD,'/row/c47') "INFO_PERIOD_END_47"
,extractValue(a.XMLRECORD,'/row/c48[position()=1]') "INFO_TOT_ACCR_AMT"
,extract(a.XMLRECORD,'/row/c48') "INFO_TOT_ACCR_AMT_48"
,extractValue(a.XMLRECORD,'/row/c49[position()=1]') "INFO_TOT_POS_ACCR_AMT"
,extract(a.XMLRECORD,'/row/c49') "INFO_TOT_POS_ACCR_AMT_49"
,extractValue(a.XMLRECORD,'/row/c50[position()=1]') "INFO_TOT_NEG_ACCR_AMT"
,extract(a.XMLRECORD,'/row/c50') "INFO_TOT_NEG_ACCR_AMT_50"
,extractValue(a.XMLRECORD,'/row/c51[position()=1]') "FINAL_SCHEDULE"
,extractValue(a.XMLRECORD,'/row/c52[position()=1]') "EFFECTIVE_DATE"
,extract(a.XMLRECORD,'/row/c52') "EFFECTIVE_DATE_52"
,extractValue(a.XMLRECORD,'/row/c53[position()=1]') "PROFIT_RATE"
,extract(a.XMLRECORD,'/row/c53') "PROFIT_RATE_53"
,extractValue(a.XMLRECORD,'/row/c54[position()=1]') "CALC_PROFIT_AMT"
,extract(a.XMLRECORD,'/row/c54') "CALC_PROFIT_AMT_54"
,extractValue(a.XMLRECORD,'/row/c55[position()=1]') "PROFIT_AMT"
,extract(a.XMLRECORD,'/row/c55') "PROFIT_AMT_55"
,extractValue(a.XMLRECORD,'/row/c56[position()=1]') "ACTIVITY_REF"
,extract(a.XMLRECORD,'/row/c56') "ACTIVITY_REF_56"
,extractValue(a.XMLRECORD,'/row/c57[position()=1]') "PROJ_FROM_DATE"
,extract(a.XMLRECORD,'/row/c57') "PROJ_FROM_DATE_57"
,extractValue(a.XMLRECORD,'/row/c58[position()=1]') "PROJ_TO_DATE"
,extract(a.XMLRECORD,'/row/c58') "PROJ_TO_DATE_58"
,extractValue(a.XMLRECORD,'/row/c59[position()=1]') "PROJ_DAYS"
,extract(a.XMLRECORD,'/row/c59') "PROJ_DAYS_59"
,extractValue(a.XMLRECORD,'/row/c60[position()=1]') "PROJ_BALANCE"
,extract(a.XMLRECORD,'/row/c60') "PROJ_BALANCE_60"
,extractValue(a.XMLRECORD,'/row/c61[position()=1]') "PROJ_BASIS"
,extract(a.XMLRECORD,'/row/c61') "PROJ_BASIS_61"
,extractValue(a.XMLRECORD,'/row/c62[position()=1]') "PROJ_RATE"
,extract(a.XMLRECORD,'/row/c62') "PROJ_RATE_62"
,extractValue(a.XMLRECORD,'/row/c63[position()=1]') "PROJ_MARGIN"
,extract(a.XMLRECORD,'/row/c63') "PROJ_MARGIN_63"
,extractValue(a.XMLRECORD,'/row/c64[position()=1]') "PROJ_ACCRUAL_AMT"
,extract(a.XMLRECORD,'/row/c64') "PROJ_ACCRUAL_AMT_64"
,extractValue(a.XMLRECORD,'/row/c65[position()=1]') "PROJ_ACT_ACC_AMT"
,extract(a.XMLRECORD,'/row/c65') "PROJ_ACT_ACC_AMT_65"
,extractValue(a.XMLRECORD,'/row/c66[position()=1]') "PROJ_COMPOUND_FQU"
,extract(a.XMLRECORD,'/row/c66') "PROJ_COMPOUND_FQU_66"
,extractValue(a.XMLRECORD,'/row/c67[position()=1]') "PROJ_COMPOUND_YIELD"
,extract(a.XMLRECORD,'/row/c67') "PROJ_COMPOUND_YIELD_67"
,extractValue(a.XMLRECORD,'/row/c68[position()=1]') "PROJ_PERIOD_START"
,extract(a.XMLRECORD,'/row/c68') "PROJ_PERIOD_START_68"
,extractValue(a.XMLRECORD,'/row/c69[position()=1]') "PROJ_PERIOD_END"
,extract(a.XMLRECORD,'/row/c69') "PROJ_PERIOD_END_69"
,extractValue(a.XMLRECORD,'/row/c70[position()=1]') "PROJ_TOT_ACCR_AMT"
,extract(a.XMLRECORD,'/row/c70') "PROJ_TOT_ACCR_AMT_70"
,extractValue(a.XMLRECORD,'/row/c71[position()=1]') "PROJ_TOT_SUSP_AMT"
,extract(a.XMLRECORD,'/row/c71') "PROJ_TOT_SUSP_AMT_71"
,extractValue(a.XMLRECORD,'/row/c72[position()=1]') "PROJ_TOT_DUE_AMT"
,extract(a.XMLRECORD,'/row/c72') "PROJ_TOT_DUE_AMT_72"
,extractValue(a.XMLRECORD,'/row/c73[position()=1]') "PROJ_TOT_RPY_AMT"
,extract(a.XMLRECORD,'/row/c73') "PROJ_TOT_RPY_AMT_73"
,extractValue(a.XMLRECORD,'/row/c74[position()=1]') "PROJ_ADJUST_INT_AMT"
,extract(a.XMLRECORD,'/row/c74') "PROJ_ADJUST_INT_AMT_74"
,extractValue(a.XMLRECORD,'/row/c75[position()=1]') "PROJ_TOT_RES_AMT"
,extract(a.XMLRECORD,'/row/c75') "PROJ_TOT_RES_AMT_75"
,extractValue(a.XMLRECORD,'/row/c76[position()=1]') "PROJ_TOT_POS_ACCR_AMT"
,extract(a.XMLRECORD,'/row/c76') "PROJ_TOT_POS_ACCR_AMT_76"
,extractValue(a.XMLRECORD,'/row/c77[position()=1]') "PROJ_TOT_NEG_ACCR_AMT"
,extract(a.XMLRECORD,'/row/c77') "PROJ_TOT_NEG_ACCR_AMT_77"
,extractValue(a.XMLRECORD,'/row/c78[position()=1]') "PROJ_INT_ACC_CM"
,extract(a.XMLRECORD,'/row/c78') "PROJ_INT_ACC_CM_78"
,extractValue(a.XMLRECORD,'/row/c79[position()=1]') "PROJ_INT_ACC_PM"
,extract(a.XMLRECORD,'/row/c79') "PROJ_INT_ACC_PM_79"
,extractValue(a.XMLRECORD,'/row/c80[position()=1]') "PROJ_INT_ACC_PY"
,extract(a.XMLRECORD,'/row/c80') "PROJ_INT_ACC_PY_80"
,extractValue(a.XMLRECORD,'/row/c81[position()=1]') "PROJ_POS_INT_ACC_PY"
,extract(a.XMLRECORD,'/row/c81') "PROJ_POS_INT_ACC_PY_81"
,extractValue(a.XMLRECORD,'/row/c82[position()=1]') PROJ_NEG_INT_ACC_PY
,extract(a.XMLRECORD,'/row/c82')"PROJ_NEG_INT_ACC_PY_82
,extractValue(a.XMLRECORD,'/row/c83[position()=1]') PROJ_POS_INT_ACC_PM
,extract(a.XMLRECORD,'/row/c83') PROJ_POS_INT_ACC_PM_83
,extractValue(a.XMLRECORD,'/row/c84[position()=1]') PROJ_NEG_INT_ACC_PM
,extract(a.XMLRECORD,'/row/c84') PROJ_NEG_INT_ACC_PM_84
,extractValue(a.XMLRECORD,'/row/c85[position()=1]') PROJ_POS_INT_ACC_CM
,extract(a.XMLRECORD,'/row/c85') PROJ_POS_INT_ACC_CM_85
,extractValue(a.XMLRECORD,'/row/c86[position()=1]') PROJ_NEG_INT_ACC_CM
,extract(a.XMLRECORD,'/row/c86') PROJ_NEG_INT_ACC_CM_86
,extractValue(a.XMLRECORD,'/row/c87[position()=1]') PROJ_INT_SUSP_CM
,extract(a.XMLRECORD,'/row/c87') PROJ_INT_SUSP_CM_87
,extractValue(a.XMLRECORD,'/row/c88[position()=1]') PROJ_INT_SUSP_PM
,extract(a.XMLRECORD,'/row/c88') PROJ_INT_SUSP_PM_88
,extractValue(a.XMLRECORD,'/row/c89[position()=1]') PROJ_INT_SUSP_PY
,extract(a.XMLRECORD,'/row/c89') PROJ_INT_SUSP_PY_89
,extractValue(a.XMLRECORD,'/row/c90[position()=1]') IPROJ_FROM_DATE
,extract(a.XMLRECORD,'/row/c90') IPROJ_FROM_DATE_90
,extractValue(a.XMLRECORD,'/row/c91[position()=1]') IPROJ_TO_DATE
,extract(a.XMLRECORD,'/row/c91') IPROJ_TO_DATE_91
,extractValue(a.XMLRECORD,'/row/c92[position()=1]') IPROJ_DAYS
,extract(a.XMLRECORD,'/row/c92') IPROJ_DAYS_92
,extractValue(a.XMLRECORD,'/row/c93[position()=1]') IPROJ_BALANCE
,extract(a.XMLRECORD,'/row/c93') IPROJ_BALANCE_93
,extractValue(a.XMLRECORD,'/row/c94[position()=1]') IPROJ_BASIS
,extract(a.XMLRECORD,'/row/c94') "IPROJ_BASIS_94"
,extractValue(a.XMLRECORD,'/row/c95[position()=1]') IPROJ_RATE
,extract(a.XMLRECORD,'/row/c95') IPROJ_RATE_95
,extractValue(a.XMLRECORD,'/row/c96[position()=1]') IPROJ_MARGIN
,extract(a.XMLRECORD,'/row/c96') IPROJ_MARGIN_96
,extractValue(a.XMLRECORD,'/row/c97[position()=1]') IPROJ_ACCRUAL_AMT
,extract(a.XMLRECORD,'/row/c97') IPROJ_ACCRUAL_AMT_97
,extractValue(a.XMLRECORD,'/row/c98[position()=1]') IPROJ_ACT_ACC_AMT
,extract(a.XMLRECORD,'/row/c98') IPROJ_ACT_ACC_AMT_98
,extractValue(a.XMLRECORD,'/row/c99[position()=1]') IPROJ_COMPOUND_FQU
,extract(a.XMLRECORD,'/row/c99') IPROJ_COMPOUND_FQU_99
,extractValue(a.XMLRECORD,'/row/c100[position()=1]') IPROJ_COMPOUND_YIELD
,extract(a.XMLRECORD,'/row/c100') IPROJ_COMPOUND_YIELD_100
,extractValue(a.XMLRECORD,'/row/c101[position()=1]') IPROJ_PERIOD_START
,extract(a.XMLRECORD,'/row/c101') IPROJ_PERIOD_START_101
,extractValue(a.XMLRECORD,'/row/c102[position()=1]') IPROJ_PERIOD_END
,extract(a.XMLRECORD,'/row/c102') IPROJ_PERIOD_END_102
,extractValue(a.XMLRECORD,'/row/c103[position()=1]') IPROJ_TOT_ACCR_AMT
,extract(a.XMLRECORD,'/row/c103') IPROJ_TOT_ACCR_AMT_103
,extractValue(a.XMLRECORD,'/row/c104[position()=1]') IPROJ_TOT_POS_ACCR_AMT
,extract(a.XMLRECORD,'/row/c104') IPROJ_TOT_POS_ACCR_AMT_104
,extractValue(a.XMLRECORD,'/row/c105[position()=1]') IPROJ_TOT_NEG_ACCR_AMT
,extract(a.XMLRECORD,'/row/c105') IPROJ_TOT_NEG_ACCR_AMT_105
,extractValue(a.XMLRECORD,'/row/c106[position()=1]') LINKED_INT_DATE
,extract(a.XMLRECORD,'/row/c106') LINKED_INT_DATE_106
,extractValue(a.XMLRECORD,'/row/c107[position()=1]') LINKED_INT_RATE
,extract(a.XMLRECORD,'/row/c107') LINKED_INT_RATE_107
,extractValue(a.XMLRECORD,'/row/c108[position()=1]') LINKED_RATE_CHANGE
,extract(a.XMLRECORD,'/row/c108') LINKED_RATE_CHANGE_108
,extractValue(a.XMLRECORD,'/row/c109[position()=1]') ABB_NEW_METHOD
,extract(a.XMLRECORD,'/row/c109') ABB_NEW_METHOD_109
,extractValue(a.XMLRECORD,'/row/c110[position()=1]') ONLINE_SCHEDULE
,extract(a.XMLRECORD,'/row/c110') ONLINE_SCHEDULE_110
,extractValue(a.XMLRECORD,'/row/c111[position()=1]') INFO_ONLINE_SCHEDULE
,extract(a.XMLRECORD,'/row/c111') INFO_ONLINE_SCHEDULE_111
,extractValue(a.XMLRECORD,'/row/c112[position()=1]') OFFSET_TYPE
,extract(a.XMLRECORD,'/row/c112') OFFSET_TYPE_112
,extractValue(a.XMLRECORD,'/row/c113[position()=1]') ADV_PAY_PERIOD_START
,extract(a.XMLRECORD,'/row/c113') ADV_PAY_PERIOD_START_113
,extractValue(a.XMLRECORD,'/row/c114[position()=1]') ADV_PAY_PERIOD_END
,extract(a.XMLRECORD,'/row/c114') ADV_PAY_PERIOD_END_114
,extractValue(a.XMLRECORD,'/row/c115[position()=1]') ADV_PAYMENT_REF
,extract(a.XMLRECORD,'/row/c115') ADV_PAYMENT_REF_115
FROM
T24.FBNK_AA_INTEREST_AC000 a
WHERE SUBSTR (RECID, 1, 12) IN
(SELECT RECID
FROM t24.fbnk_aa_arrangement
WHERE EXTRACTVALUE (XMLRECORD, '/row/c15[position()=1]') =
'LENDING'
OR ( EXTRACTVALUE (XMLRECORD, '/row/c15[position()=1]') =
'ACCOUNTS'
AND EXTRACTVALUE (XMLRECORD, '/row/c17[position()=1]') =
'OVER.DRAFT.ACCOUNT'))

You might also like