Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Optional Variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Optional Variable
 Login/Join
 
Member
posted
SELECT
A.AUTH_ID as AUTHORITY NUMBER,
A.CUST_ID AS ID,
A.QLF_SET_ID AS QUALIFIER_SET,
A.INCD_DT AS INCD_DT,
A.EXP_DT AS EXP_DT,
A.QLF_SET_DESC AS DESCRIPTION
FROM
MMST_HEADER A,
(SELECT
AUTH_ID,
MAX(PAUTH_SEQ_NUMB) AS MXSEQ
FROM
MMST_HEADER
GROUP BY 1) B
WHERE
A.AUTH_ID = B.AUTH_ID AND
A.PAUTH_SEQ_NUMB = MXSEQ AND
A.AUTH_ID = 'EP2301' /* THIS IS A VARIABLE AND SHOULD BE REQUIRED */
AND EXP_DT > '2008-04-12' /* THIS IS A VARIABLE AND SHOULD BE REQUIRED */
AND PROV_ID IN ('02','03','04') /* THIS IS A VARIABLE AND SHOULD NOT BE REQUIRED */

ORDER BY PROV_ID, QUALIFIER_SET

;

-DEFAULT &AUTH_ID='EP2301';
-DEFAULT &EXP-DT='2008-01-12';
-DEFAULT PROV_ID-'';-* I have got three values '02','03','04'.So how should I project these three values as the default variables.


-*If it was a single value for PROV_ID ex.'02' I could have removed it from the where statement and write this statment.

-SET &WHERE_PROV_ID=IF &PROV_ID EQ '' THEN '' ELSE 'AND PROV_ID=''&PROV_ID'';

This message has been edited. Last edited by: Kerry,


WebFocus 7.6.11
Windows XP
Excel
 
Posts: 4 | Registered: October 12, 2010Report This Post
Virtuoso
posted Hide Post
If your CUST_ID is optional then you need to have something that tells the code that it is optional. And you can check on that. For instance:
AUTH_ID='&AUTH_ID'
AND CUST_NBR='&CUST_NBR'
-IF &OPTIONAL EQ 'YES' THEN GOTO :Continue;
AND CUST_ID IN ('02','03','04')
-:Continue


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
As Gamp asks, What makes the test optional, a supplied value, a data value, something else ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
quote:
AND PROV_ID IN ('02','03','04') /* THIS IS A VARIABLE AND SHOULD NOT BE REQUIRED */



The values '02','03','04' are already supplied.I am confused as 'IN' is present.

AND PROV_ID IN ('02','03','04') /* THIS IS A VARIABLE AND SHOULD NOT BE REQUIRED */


WebFocus 7.6.11
Windows XP
Excel
 
Posts: 4 | Registered: October 12, 2010Report This Post
Expert
posted Hide Post
I am confused, as a test againsta list requires an IN statement.

In what circumstances should this test be done, or not be done ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
quote:
AND PROV_ID IN ('02','03','04') /* THIS IS A VARIABLE AND SHOULD NOT BE REQUIRED */
In this statement it is not variable. So if you want to make it variable, then you have to create something to make it variable. And since it is obviously required to be able to select more then 1 value, it has to be a multi-select variable. If you create such a variable that also can contain a sort of select all value, then this variable will be returned to the fex with value FOC_NONE or with the selected values in the form "'02' OR '03' OR '04'". So, if that is the case, the only thing you need to do should be to specify 'AND PROV_ID EQ &PROV_ID', provided the variable is called &PROV_ID. Otherwise please explain exactly what it is that you're looking for.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Optional Variable

Copyright © 1996-2020 Information Builders