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     Reading a SQL Result into a variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Reading a SQL Result into a variable
 Login/Join
 
Member
posted
I have a table which has 7 flags. Each row in that table has a key value and each row will have only one of teh flags turned on

so, if I query by the PK of that table, I will see one and only one flag ON. Based on the flag which is ON, I will know which table to query from for generating my report.

Now, can any one tell me how do i implement my top IF condition?
Can I read that flag into a local variable and say like

IF FLAG1 = 'Y' THEN

TABLE FILE MASTER1
...
END
ELSE IF FLAG2 = 'Y' THEN
TABLE FILE MASTER2
...
END
ELSE IF FLAG3 ='Y' THEN
TABLE FILE MASTER3
...
END
END
 
Posts: 3 | Registered: June 08, 2006Report This Post
Platinum Member
posted Hide Post
Two reports, first to retrieve Master name (using a defined field with your IF condition) and second to generate your report (I'm supposing the structure of differents tables are the same)

-* Define MASTER in function of flags.
DEFINE FILE ptable
  MASTER/A64 = 
    IF FLAG1 EQ 'Y' THEN 'MASTER1' ELSE
    IF FLAG2 EQ 'Y' THEN 'MASTER2' ELSE
    ...
    ELSE '?' ;
END

-* Report to retrieve MASTER.
TABLE FILE ptable
  PRINT MASTER
  WHERE PK ...
  ON TABLE HOLD FORMAT ALPHA
END
-RUN

-* Read MASTER name.
-DEFAULT &MASTER = '?' ;
-READ HOLD &MASTER.A64.
-TYPE MASTER = &MASTER
-IF &MASTER EQ '?' THEN GOTO ... ;

-* Depending structures, we can use
-* -INCLUDE &MASTER or EX &MASTER or complex IF THEN GOTO

-* Final report
TABLE FILE &MASTER
...
END
-RUN

Regards,
Mikel

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


WebFOCUS 8.1.05, 8.2.01
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report 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     Reading a SQL Result into a variable

Copyright © 1996-2020 Information Builders