Focal Point
SQL Bit

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8891003312

February 15, 2007, 09:33 AM
gkata
SQL Bit
I have a SQL table that has a column with a format of BIT. When I query the column in WebFOCUS the value comes back with a -1 (in sql it comes back as 1). Based on the advise of the IBI site, I used the "ABS" rountine to correct this. Although, with this method I would have to define this all the time. I could add a DEFINE to the master, but does anyone know of a work-around, for the Metadata?
February 15, 2007, 11:13 AM
FrankDutch
You might let this value as is.
The other value is 0 so the meaning will probably be true and false.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

February 16, 2007, 09:56 AM
Kerry
Hi gkata,

This is a known issue: Reading BIT data types from a SQL Server Database

To correct the metadata/synonym, you can create a define field with the ABS subroutine in your master file. Unfortunately, currently the ABS subroutine is the only workaround.

Hope this helps. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
February 16, 2007, 12:05 PM
susannah
I like amsterdam's suggestion
Since the value is a boolean, your fexes will work whether the value is -1 or 1
DEFINE FILE CAR
TEMP/I2 WITH CAR=IF COUNTRY IS 'ENGLAND' THEN -1 ELSE 0;
TESTYES/A3 = IF TEMP THEN 'YES' ELSE ' ';
TESTNO/A3=IF NOT TEMP THEN 'NOT' ELSE ' ';
END
TABLE FILE CAR
PRINT TEMP TESTYES TESTNO
END
...
if this doesn't work for you, and you don't want to use ABS , you could always square the variable ... but amsterdam's answer really makes the most sense, imho.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID