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] WebFOCUS guessing column names

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] WebFOCUS guessing column names
 Login/Join
 
Virtuoso
posted
I'm finding myself in a situation where I'm defining joins in the text editor and WebFOCUS is picking up DIFFERENT columns to join on than the ones I explicitly specified. The columns it picks start with the name of the column I specified.

For example, in table GERTYP I have columns:
GERTYPE
GERTYPEAANT

If I specify:
JOIN
 GERTYPE IN stuklst TO
 GERTYPE IN gertyp AS J0
 END


If I then open that join in the join-editor I find WebFOCUS actually joined on GERTYPEAANT! I explicitly told it to join on GERTYPE.

How do I turn that off?

This message has been edited. Last edited by: Kerry,


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
<JG>
posted
Neat FOCUS/WebFOCUS feature called shortest unique truncation

Try using

SET FIELDNAME=NOTRUNC
 
Report This Post
Expert
posted Hide Post
quote:
I explicitly told it to join on GERTYP
You don't have a column called GERTYP in table GERTYP, you have GERTYPE and GERTYPEAANT. Do as JG suggests or, even better, start using the complete column names.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Francis Mariani:
quote:
I explicitly told it to join on GERTYP
You don't have a column called GERTYP in table GERTYP, you have GERTYPE and GERTYPEAANT. Do as JG suggests or, even better, start using the complete column names.


That was a typo, as you can see from my earlier examples. The names are confusing too, that doesn't help.


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by JG:
Neat FOCUS/WebFOCUS feature called shortest unique truncation


I don't agree with that opinion, it's not neat, it's plain dangerous!

A small typo can cause you to get subtly wrong data (from a different column), which can go unnoticed for quite a while and could have implications. For example, if you're working on a financial report involved in decisions.

It's much better to get an error that the column couldn't be found than substituting a "most likely" candidate column if no match was found and return wrong results.

Features like these tend to get deprecated, and for good reasons.


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
<JG>
posted
It's been part of FOCUS and WebFOCUS for a very, very long time.

The earliest reference I can find is 1998 but it predates that.

In your case this appears to be a bug because you have 2 columns

GERTYPE & GERTYPEAANT

Meaning GERTYPE is a unique truncation of GERTYPEAANT
But you have an untruncated column name matching the truncated name.

Bad Practice to be honest.

the error if there is a none unique truncation is

(FOC016) THE TRUNCATED FIELDNAME IS NOT UNIQUE : truncated name
 
Report This Post
Expert
posted Hide Post
The simplest solution here is to have, and always have unique names, this is the least dangerous option.


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
Virtuoso
posted Hide Post
Are you saying it is bad practice to have column names GERTYPE & GERTYPEAANT? That people should change their database design practices because of WebFOCUS? Or are you referring to the typo in my earlier post, about which I already explained that it was just a typo in the message (and which I corrected by now)?


This "shortest unique truncation" feature doesn't seem to have much merit, while it obfuscates FOCUS code and is a big gun aimed at your feet in the case described. IMHO it should be disabled by default. That's what happens to foot-guns in other products.


For example, in Postgres (the database) there used to be (and still is) a setting named 'add_missing_from_clause'. That setting, when enabled, guesses table names that were referenced in the query but that are not present in the FROM-clause. Someone several decennia ago thought that would be a good idea.

The result was that people making a typo in a table-name or alias in a column-reference found their queries turned into a self-join resulting in an undesired Cartesian product!

Thankfully the Postgres developers had the sense to disable that option by default. I've been using Postgres for over 10 years now, and that feature's been off for as long as I can remember.

That's the sensible thing to do with this "shortest unique truncation" feature.


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
You should understand that changing defaults can cause many problems, and doubt that IBI will ever do that. So put the setting in your server profile.


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
<JG>
posted
As I said.

In your case this appears to be a bug.

You need to raise a case with IBI
 
Report This Post
Virtuoso
posted Hide Post
quote:
The earliest reference I can find is 1998 but it predates that


The earliest reference I can remember is in PC Focus version from 1985 (or was it 1984). Very nice functon, but I do understand that newbies get a bit confused.
An other good reason to do some training and read the FM.




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

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Virtuoso
posted Hide Post
What I don't get is why you all consider this to be a good feature. Can you elaborate on what's good about it? It goes against everything I've learned about good design paradigms, so I'm really quite curious what your arguments in favour are.


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report 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] WebFOCUS guessing column names

Copyright © 1996-2020 Information Builders