Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Bit Data Type Error
Go
New
Search
Notify
Tools
Reply
  
[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, 2016Reply With QuoteReport 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.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6104 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport This Post
Platinum Member
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: 246 | Location: Palm Coast, FL | Registered: February 05, 2010Reply With QuoteReport 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, 2015Reply With QuoteReport 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.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6104 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport 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.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5601 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport 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 8203
WindowsServer 2012 R2,
Excel, PDF, HTML, ActiveReports
 
Posts: 124 | Location: Minnesota | Registered: August 26, 2013Reply With QuoteReport 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 8203
WindowsServer 2012 R2,
Excel, PDF, HTML, ActiveReports
 
Posts: 124 | Location: Minnesota | Registered: August 26, 2013Reply With QuoteReport 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, 2014Reply With QuoteReport 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, 2016Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Bit Data Type Error

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.