Focal Point
[CLOSED] SYSCOLUM and character case

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

November 16, 2011, 02:51 PM
Dan Pinault
[CLOSED] SYSCOLUM and character case
Hey Focs!
I haven't been on Focal Point for a while. I hope I didn't miss anything exciting Wink

Please take a look at the two Ad Hoc procedures below and tell me if I'm dreaming or something...

TABLE FILE SYSCOLUM 
PRINT TBNAME TABLE_NAME FILENAME
WHERE TBNAME EQ 'car';
END


This returns
TBNAME TABLE_NAME FILENAME
car car CAR

and this
TABLE FILE SYSCOLUM 
PRINT TBNAME TABLE_NAME FILENAME
WHERE TBNAME EQ 'CAR';
END


returns
TBNAME TABLE_NAME FILENAME
CAR CAR CAR

How can this be???

This message has been edited. Last edited by: Dan Pinault,


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
November 16, 2011, 05:18 PM
njsden
quote:
I'm dreaming or something...


No, you're not ... unless we both are.

In fact, I queried SYSCOLUM with other variations of 'CAR': Car, cAr, CAr, etc. and in all cases, TBNAME and TABLE_NAME fields display the value exactly as it was specified in the WHERE condition.

SYSCOLUM is a "special" master and perhaps its internal wiring is designed to work that way. I tested querying other master files (the ones I have defined over a few Oracle tbles) and the behaviour is the same so it's nothing related only to FOCUS files.

Very interesting ...



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
November 17, 2011, 04:13 AM
Wep5622
Well, table names are of course case-insensitive in SQL, so those results amount to the same thing for SQL. You'd expect to get the table name case-folded to either upper-case or lower-case in a consistent manner, though.

However, it gets more interesting when you use LIKE...
TABLE SYSCOLUM
BY TBNAME 
BY TABLE_NAME
BY FILENAME
WHERE TBNAME LIKE 'car%';
END


That gets us: car car CAR

Now try it in uppercase:
TABLE SYSCOLUM
BY TBNAME 
BY TABLE_NAME
BY FILENAME
WHERE TBNAME LIKE 'CAR%';
END


That get us: nothing!

I think there may be a difference to do with NLS handling between those two operators.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
November 17, 2011, 04:59 AM
HÃ¥kan
My best guess would be it rather depends on whether you set the collation to be case-sensitive or not. It's not a matter of NLS.


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
November 18, 2011, 09:19 AM
Dan Pinault
Hmm - I'll take a look at the collation settings. For most things we are doing it's not an issue but we've starting using the &&IBI_IF_FLDS variable to limit access to certain fields. Everywhere else we reference table names in upper case but in this particular case (pun intended) we need to do it like this...
WHERE ((TBNAME EQ 'mytable') AND (NAME EQ 'COL1' OR 'COL2' OR 'COL3'));


Thanks to everyone for confirming my sanity Big Grin

Dan


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
November 18, 2011, 01:32 PM
Norb Eckert
Frankly Dan, I'm not so sure that this does confirm your sanity. Music

Later,

Norb


prod:7.6.9, win2k3 mre, caster, bid, devstudio 7.6.9
November 19, 2011, 11:11 AM
Dan Pinault
Prolly not, but that's only because you know me personally!


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
November 21, 2011, 01:34 PM
Norb Eckert
Dan

I'm glad you saw the humor. Sweating

Hope all is well with you and that you have a wonderful Thanksgiving holiday.

Regards,

Norb


prod:7.6.9, win2k3 mre, caster, bid, devstudio 7.6.9