0% found this document useful (0 votes)
220 views

SQL From WEBI Report

The SQL query selects data from multiple tables, including ARS_BK_ELIG_MSTR_FACT, ARS_OWNER.ARS_PRODUCT_DIMN, and DWCSADM.ACCT_DIMN_CURR. It applies filters to the data, such as requiring the CLI_TRD_ALW_STRT_C field to not be null and setting date and flag fields to specific values. The query also includes decoding and case statements to transform some column values during selection.

Uploaded by

sunil4td
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
220 views

SQL From WEBI Report

The SQL query selects data from multiple tables, including ARS_BK_ELIG_MSTR_FACT, ARS_OWNER.ARS_PRODUCT_DIMN, and DWCSADM.ACCT_DIMN_CURR. It applies filters to the data, such as requiring the CLI_TRD_ALW_STRT_C field to not be null and setting date and flag fields to specific values. The query also includes decoding and case statements to transform some column values during selection.

Uploaded by

sunil4td
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

SQL from WEBI report:

SELECT

ARS_BK_ELIG_MSTR_FACT.CLI_TRD_ALW_STRT_C ,

ARS_BK_ELIG_MSTR_FACT.ACC_I,

DECODE (ARS_OWNER.ARS_PRODUCT_DIMN.PRO_CLASFN_C, 'DAPR',

ARS_BK_ELIG_MSTR_FACT.AST_CURR_INT_Z *

ARS_OWNER.ARS_PRODUCT_DIMN.PAR_VAL_A, 'MBAC',

ARS_BK_ELIG_MSTR_FACT.AST_CURR_INT_Z)

DECODE (ARS_OWNER.ARS_PRODUCT_DIMN.PRO_CLASFN_C, 'DAPR',

ARS_BK_ELIG_MSTR_FACT.AST_CURR_EXT_Z *

ARS_OWNER.ARS_PRODUCT_DIMN.PAR_VAL_A, 'MBAC',

ARS_BK_ELIG_MSTR_FACT.AST_CURR_EXT_Z),

CASE WHEN Table__189.ACC_N IS NULL THEN 'N' ELSE 'Y'

END,

DWCSADM.ACCT_DIMN_CURR.FA_I,

ARS_BK_ELIG_MSTR_FACT.ACC_N

FROM

SELECT DISTINCT ARS_OPTIN_FACT.ACC_N

from ARS_OPTIN_FACT

WHERE ARS_OPTIN_FACT.ARS_DOC_C <>'S9'

) Table__189,

ARS_BK_ELIG_MSTR_FACT,

ARS_OWNER.ARS_PRODUCT_DIMN,

DWCSADM.ACCT_DIMN_CURR

WHERE
( ARS_OWNER.ARS_PRODUCT_DIMN.PW_SCTY_I=ARS_BK_ELIG_MSTR_FACT.PW_SCTY

_I AND ARS_OWNER.ARS_PRODUCT_DIMN.CURR_VER_C = 'Y' )

AND ( Table__189.ACC_N(+)=ARS_BK_ELIG_MSTR_FACT.ACC_N )

AND ( DWCSADM.ACCT_DIMN_CURR.ACC_N=ARS_BK_ELIG_MSTR_FACT.ACC_N )

AND ( ARS_BK_ELIG_MSTR_FACT.CLI_TRD_ALW_STRT_C IS NOT NULL )

AND

ARS_BK_ELIG_MSTR_FACT.EDW_PSTG_D = '13-10-2010 00:00:00'

AND

ARS_BK_ELIG_MSTR_FACT.AST_CURR_INT_Z+ARS_BK_ELIG_MSTR_FACT.AST_CURR_E

XT_Z > 0

AND

ARS_OWNER.ARS_PRODUCT_DIMN.CURR_VER_C = 'Y'

AND

DWCSADM.ACCT_DIMN_CURR.CURR_VER_C = 'Y'

AND

ARS_OWNER.ARS_PRODUCT_DIMN.PW_SCTY_I =

ARS_BK_ELIG_MSTR_FACT.PW_SCTY_I

SQL from backend:

SELECT DISTINCT

ARS_BK_ELIG_MSTR_FACT.CLI_TRD_ALW_STRT_C ,

ARS_BK_ELIG_MSTR_FACT.ACC_I,

DECODE (ARS_OWNER.ARS_PRODUCT_DIMN.PRO_CLASFN_C, 'DAPR',

ARS_BK_ELIG_MSTR_FACT.AST_CURR_INT_Z * ARS_OWNER.ARS_PRODUCT_DIMN.PAR_VAL_A,

'MBAC', ARS_BK_ELIG_MSTR_FACT.AST_CURR_INT_Z)
,

DECODE (ARS_OWNER.ARS_PRODUCT_DIMN.PRO_CLASFN_C, 'DAPR',

ARS_BK_ELIG_MSTR_FACT.AST_CURR_EXT_Z * ARS_OWNER.ARS_PRODUCT_DIMN.PAR_VAL_A,

'MBAC', ARS_BK_ELIG_MSTR_FACT.AST_CURR_EXT_Z),

CASE WHEN Table__189.ACC_N IS NULL THEN 'N' ELSE 'Y'

END,

DWCSADM.ACCT_DIMN_CURR.FA_I,

ARS_BK_ELIG_MSTR_FACT.ACC_N

FROM

SELECT DISTINCT ARS_OPTIN_FACT.ACC_N

from ARS_OWNER.ARS_OPTIN_FACT

WHERE ARS_OPTIN_FACT.ARS_DOC_C <>'S9'

) Table__189,

ARS_OWNER.ARS_BK_ELIG_MSTR_FACT,

ARS_OWNER.ARS_PRODUCT_DIMN,

DWCSADM.ACCT_DIMN_CURR

WHERE

( ARS_OWNER.ARS_PRODUCT_DIMN.PW_SCTY_I=ARS_BK_ELIG_MSTR_FACT.PW_SCTY_I AND

ARS_OWNER.ARS_PRODUCT_DIMN.CURR_VER_C = 'Y' )

AND ( Table__189.ACC_N(+)=ARS_BK_ELIG_MSTR_FACT.ACC_N )

AND ( DWCSADM.ACCT_DIMN_CURR.ACC_N=ARS_BK_ELIG_MSTR_FACT.ACC_N )

AND ( ARS_BK_ELIG_MSTR_FACT.CLI_TRD_ALW_STRT_C IS NOT NULL )

AND

ARS_BK_ELIG_MSTR_FACT.EDW_PSTG_D = '13-OCT-2010'

AND

ARS_BK_ELIG_MSTR_FACT.AST_CURR_INT_Z+ARS_BK_ELIG_MSTR_FACT.AST_CURR_EXT_Z >

0
AND

ARS_OWNER.ARS_PRODUCT_DIMN.CURR_VER_C = 'Y'

AND

DWCSADM.ACCT_DIMN_CURR.CURR_VER_C = 'Y'

AND

ARS_OWNER.ARS_PRODUCT_DIMN.PW_SCTY_I = ARS_BK_ELIG_MSTR_FACT.PW_SCTY_I

You might also like