As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
CASE WHEN CALC_PAYROLL.N_PUZZLE IN (‘ABC’,’DEF’,GHI,LMN,) Then (X_PAY_ITEM * X_PAYT_FUND) else 0 END as GROUP_COST_FULL, Etc. CALC_AGGR_FNL_D_PAY_RT_ITEM, FROM DM.DM_EPPE_BILLG_RES_NPC_FNL_F CALC_RES_FNL LEFT JOIN DM.DM_EPPE_BILLG_RES_NPC_AGGR_F CALC_AGGR_FNL ON CALC_RES_FNL.I_RES_FNL_ID = CALC_AGGR_FNL.I_RES_FNL_ID LEFT JOIN DM.DM_EPPE_TMD_PRTNR_DEMO PTNR_DEMO_FNL ON CALC_RES_FNL.I_PTNR_ID = PTNR_DEMO_FNL.PTNR_ID LEFT JOIN DM.DM_EPPE_INBND_MRCHNTATTR_NPC INBND_MRCHNT_ATTR_NPC ON CALC_RES_FNL.I_LCL_ENTY = INBND_MRCHNT_ATTR_NPC.MRCHNT_NBR LEFT JOIN DM.DM_EPPE_MRCHNT_GRP_ASSOCN_FNL MRCHNT_GRP_ASSOCN_FNL ON CALC_RES_FNL.I_LCL_ENTY = MRCHNT_GRP_ASSOCN_FNL.MRCHNT_ID LEFT JOIN DM.DM_EPPE_MRCHNT_ATRB_FNL MRCHNT_ATTR_FNL ON CALC_RES_FNL.I_LCL_ENTY = MRCHNT_ATTR_FNL.MRCHNT_ID LEFT JOIN DM.DM_EPPE_RPT_PTNR_STMT_XREF PTNR_STMT_XREF ON CALC_RES_FNL.C_RES_CODE = PTNR_STMT_XREF.LKPUP_CDE LEFT JOIN DM.DM_EPPE_BILLG_PTNR_SRVC_FNL PRD_FNL ON CALC_RES_FNL.C_RES_CODE = PRD_FNL.PRODUCT ; END -RUN
While working with SQL passthru in WebFOCUS it seems like I'm working in a world (SQL) within another world (WebFOCUS) regarding things like the proper syntax for commenting a single line or commenting out multiple lines.
Can anyone pass the wisdom?
1. How to comment a single line of SQL code, is it /* or is it -* as in WebFOCUS? 2. In WebFOCUS, I know to place the 'IF RECORDLIMIT EQ 5' before the END statement in a focexec. Can I see an example of the LIMIT 5 used in SQL passthru?
Thank you. TomThis message has been edited. Last edited by: FP Mod Chuck,
If I recall correctly the /* */ will work, the SQL style double dashes -- will not and throw an error. I don't remember if the WF style comments throw an error, possible if it's contained within the portion you're sending to the Oracle Db.
I see you're using the Oracle adapter, so you'd have to use the Oracle method for limit, like SELECT * FROM (your table) WHERE ROWNUM <= 5 ORDER BY column
Using a SQL Passthru in a fex I have found it's better to use the WebFOCUS comment -* . WebFOCUS just ignores that line of code and it doesn't get passed. If using an external SQL file you should use the SQL specific comment for the engine that you are using.
To limit the records you can always just use the focus command. The SQL Passthru basically builds a temporary view and no query is run nor data is passed until you request the data.
ENGINE SQLORA SET DEFAULT CONNECTION DataPigsnslop
SQL SQLORA PREPARE SQLOUT FOR
SELECT
APP1.DATE,
APP1.SEQ_NO,
APP1.SEQ_NAME,
ANGELS.AGNT_BANK_NO,
ANGELS.AGNT_BANK_NME,
ANGELS.ASSOCN_NUM,
ANGELS.ASSOCN_NME
CASE WHEN CALC_PAYROLL.N_PUZZLE IN (‘ABC’,’DEF’,GHI,LMN,)
Then (X_PAY_ITEM * X_PAYT_FUND) else 0
END as GROUP_COST_FULL,
Etc.
CALC_AGGR_FNL_D_PAY_RT_ITEM,
FROM
DM.DM_EPPE_BILLG_RES_NPC_FNL_F CALC_RES_FNL
LEFT JOIN
DM.DM_EPPE_BILLG_RES_NPC_AGGR_F CALC_AGGR_FNL ON CALC_RES_FNL.I_RES_FNL_ID = CALC_AGGR_FNL.I_RES_FNL_ID
LEFT JOIN
DM.DM_EPPE_TMD_PRTNR_DEMO PTNR_DEMO_FNL ON CALC_RES_FNL.I_PTNR_ID = PTNR_DEMO_FNL.PTNR_ID
LEFT JOIN
DM.DM_EPPE_INBND_MRCHNTATTR_NPC INBND_MRCHNT_ATTR_NPC ON CALC_RES_FNL.I_LCL_ENTY = INBND_MRCHNT_ATTR_NPC.MRCHNT_NBR
LEFT JOIN
DM.DM_EPPE_MRCHNT_GRP_ASSOCN_FNL MRCHNT_GRP_ASSOCN_FNL ON CALC_RES_FNL.I_LCL_ENTY = MRCHNT_GRP_ASSOCN_FNL.MRCHNT_ID
LEFT JOIN
DM.DM_EPPE_MRCHNT_ATRB_FNL MRCHNT_ATTR_FNL ON CALC_RES_FNL.I_LCL_ENTY = MRCHNT_ATTR_FNL.MRCHNT_ID
LEFT JOIN
DM.DM_EPPE_RPT_PTNR_STMT_XREF PTNR_STMT_XREF ON CALC_RES_FNL.C_RES_CODE = PTNR_STMT_XREF.LKPUP_CDE
LEFT JOIN
DM.DM_EPPE_BILLG_PTNR_SRVC_FNL PRD_FNL ON CALC_RES_FNL.C_RES_CODE = PRD_FNL.PRODUCT
;
END
TABLE FILE SQLOUT
PRINT *
WHERE RECORDLIMIT EQ 10
END
-RUN
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015
Hey Tom, for SQL you'd only need one WHERE then combine the criteria with AND/OR, so for your example:
WHERE PRD_FNL.DIV = 'NPC' AND ROWNUM <= 5;
I'm a little curious for the need of a limit, are you testing a small sample of records coming in, or do you need something like the Top 5 or most Recent 5 transactions?