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] Cannot convert 'INT4' to 'BOOL'

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Cannot convert 'INT4' to 'BOOL'
 Login/Join
 
Platinum Member
posted
Hi All,

I have BOOLEAN data type field in my table and and I created synonym on it,

Below is the master file snapshot of FLAG filed ,
 FIELDNAME=FLAG, ALIAS=FLAG, USAGE=I11, ACTUAL=I4,  


Now i need to perform conditional operation based on flag field , If I am using below condition , it says Cannot convert 'INT4' to 'BOOL'

 DEFINE FILE XYZ
A_SALE/D12= IF( FLAG EQ 0 ) THEN SALES ELSE 0;
B_SALE/D12= IF( FLAG EQ 1 ) THEN SALES ELSE 0;
END

TABLE FILE XYZ
SUM A_SALES
B_SALES
BY FILED_A
END  


I did a workaround and that works , I created another field using FLAG field and change the DATA type to check condition on it

 DEFINE FILE XYZ
D_FLAG/I1 = EDIT(FLAG);
A_SALE/D12= IF( D_FLAG EQ 0 ) THEN SALES ELSE 0;
B_SALE/D12= IF( D_FLAG EQ 1 ) THEN SALES ELSE 0;
END

TABLE FILE XYZ
SUM A_SALES
B_SALES
BY FILED_A
END  


Is there any way where I would be able to use FLAG field directly instead of creating another field .

This message has been edited. Last edited by: FP Mod Chuck,


WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
 
Posts: 186 | Location: Infobuild India | Registered: August 28, 2015Report This Post
Virtuoso
posted Hide Post
I think that WF can convert the BOOL to Integer. However, when you issue a test of the field, WF doesn't know that the original field is boolean hence the SQL message.
I would suggest 2 possibilities:
1. Try changing the field to USAGE=I1, ACTUAL=I1 and see what happens
2. If this does not work, put the DEFINE in the Master, without using EDIT: DEFINE D_FLAG/I1=FLAG;


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Platinum Member
posted Hide Post
quote:
1. Try changing the field to USAGE=I1, ACTUAL=I1 and see what happens
2. If this does not work, put the DEFINE in the Master, without using EDIT: DEFINE D_FLAG/I1=FLAG;


Thanks Danny-SRL ,

I tried both the suggestions .None of these does work for me.


WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
 
Posts: 186 | Location: Infobuild India | Registered: August 28, 2015Report This Post
Virtuoso
posted Hide Post
My suspicion:

As long as the table request does not attempt to pass through an arithmetic expression treating the Boolean FLAG field as an integer value, table requests a boolean value (True or False) and takes care of the rest. -- But when table tries to pass through the expression

IF( FLAG EQ 0 ) THEN SALES ELSE 0;

as a Select column, the SQL server raises a syntax error (cannot convert 0 to Boolean).

To test that hunch, see what happens with:
TABLE FILE XYZ
PRINT FLAG SALE FIELD_A
on table set recordlimit 1000
ON TABLE HOLD
END

DEFINE FILE HOLD
A_SALE/D12= IF( FLAG EQ 0 ) THEN SALES ELSE 0;
B_SALE/D12= IF( FLAG EQ 1 ) THEN SALES ELSE 0;
END

TABLE FILE HOLD
SUM A_SALES B_SALES
BY FIELD_A
END


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report 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] Cannot convert 'INT4' to 'BOOL'

Copyright © 1996-2020 Information Builders