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]Bit Data Type Error

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Bit Data Type Error
 Login/Join
 
Member
posted
I have a report that includes a bit data type field from a SQL Server 2012 database whose values are either 0 or 1. For some reason the 1 values are read as -1.

I'm able to suppress the minus sign, but that only changes how the field is displayed. Any values of 1 are still read as -1.

The following is the default description of the field in the masterfile:

 FIELDNAME=ISPRIMARY, ALIAS=IsPrimary, USAGE=I11, ACTUAL=I4, FIELDTYPE=R, $ 


The documentation (Describing Data With WebFOCUS Language 8.08) says that binary integers may be specified as one of the following: I1, I2, I4, I8. It also notes the USAGE must be either P or D. I've tried both with no luck.

Also, I'm not sure why the documentation specifies that for ACTUAL to USAGE conversions ACTUAL integer is only automatically converted to either USAGE integer or date when it also says to set the USAGE for binary integers to either P or D.

This message has been edited. Last edited by: <Emily McAllister>,


Release 8.08
Windows Server 2008
Excel, HTML
 
Posts: 8 | Registered: April 06, 2016Report This Post
Expert
posted Hide Post
If its not working correctly, you may have to open a case with Techsupport


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
Guru
posted Hide Post
I've got the same thing going on here. I would be most interested in hearing how this plays out. For now, when I need to test the field, I test for NE 0 instead of EQ 1 or EQ -1.


Webfocus 8
Windows, Linux
 
Posts: 258 | Location: Palm Coast, FL | Registered: February 05, 2010Report This Post
Member
posted Hide Post
I have also noticed this same error. After looking at the masterfile and seeing to error, I just decided to check for -1 instead of 1. I would also be interested in the outcome if you open a case.


WebFOCUS 8105
Windows, All Outputs
 
Posts: 22 | Registered: May 14, 2015Report This Post
Expert
posted Hide Post
What would happen if you tested for ABS(field) EQ 1 ?

Does it translate to SQL ?


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
Expert
posted Hide Post
What about trying the BITVAL function?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Here's my solution to the BIT issue.

We have a SQL Server table with a BIT field for ACTIVE employees.

We do a little define action:

DEFINE FILE H2O_GENSUITEPARSEEMPLOYEES ADD
BIT_VALUE/I1 = IF ACTIVE EQ -1 THEN 1 ELSE ACTIVE;
END

Then I use that in my WHERE statement:

WHERE BIT_VALUE EQ 1;


webFOCUS 8207.15
WindowsServer 2019
 
Posts: 120 | Location: Minnesota | Registered: August 26, 2013Report This Post
Platinum Member
posted Hide Post
quote:

What would happen if you tested for ABS(field) EQ 1 ?


This sounds clever - I don't think I would have ever thought of this way.


webFOCUS 8207.15
WindowsServer 2019
 
Posts: 120 | Location: Minnesota | Registered: August 26, 2013Report This Post
Master
posted Hide Post
I use stored procs for all SQL access and usually cast my bits to int, before returning to WF.

select cast(mybit as int) 'mybit'
, second_col
.....



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Member
posted Hide Post
Thank you everyone for the suggestions. I've used some of these workarounds in the past, so that wasn't the issue. I was just trying to figure out why this problem was occurring in the first place.

I'll try to open a case since it seems like I'm not the only one who has seen this. I think for the time being, I'll use defines in the master file itself so the data appears as it is in the database.


Release 8.08
Windows Server 2008
Excel, HTML
 
Posts: 8 | Registered: April 06, 2016Report 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]Bit Data Type Error

Copyright © 1996-2020 Information Builders