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     OPERATOR + INCOMPATIBLE WITH OPERANDS

Read-Only Read-Only Topic
Go
Search
Notify
Tools
OPERATOR + INCOMPATIBLE WITH OPERANDS
 Login/Join
 
Silver Member
posted
I need to concatanate fields from SQL 2005 table. If I run the following code
  
DEFINE FILE TALERTS_SENT
  FMT_JNUM/A12 = JOB_NUMBER;
  FMT_SENTTO/A30 = SENT_TO;
END

SQL
  SELECT FMT_JNUM+FMT_SENTTO FROM DW.TALERTS_SENT;
END

I get error - (FOC14014) OPERATOR + INCOMPATIBLE WITH OPERANDS (FMT_JNUM + FMT_SENTTO)
Note that if I use just 1 field (FMT_JNUM or FMT_SENTTO) then it works fine.
These fields are A12V and A30V in master file. I tried to change to A12 and A30 in master file as well as I tried to use DEFINE (see code above), but no luck.
Thanks.


WF 7.6.4, Win XP, SQL 2005
 
Posts: 42 | Location: California | Registered: August 17, 2007Report This Post
Platinum Member
posted Hide Post
quote:
fields are A12V and A30V in master file. I tried to change to A12 and A30 in master file as well as I tried to use DEFINE (see code above), but no luck.



Perhaps replace the + with either a | or a double ||...

| - Will concatenate
|| - Will Concatenate and trim extra spaces

TABLE FILE CAR
PRINT *
COMPUTE TEST/A50 = COUNTRY | CAR;
END


WebFOCUS 8201M/Windows Platform
 
Posts: 109 | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Why not do the concatenation in the DEFINE?

DEFINE FILE CAR
COUNTRYV/A40V = COUNTRY;
MODELV/A40V = MODEL;
CM/A80 = COUNTRYV || MODELV;
CMV/A80V = COUNTRYV || MODELV;
END

SQL
SELECT CM, CMV FROM CAR
END


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
Silver Member
posted Hide Post
Double || works. Thanks a lot for fast response. I did the same in SQL Server Query Editor with '+' sign and I assumed that I should use the same syntax in WebFocus SQL Translator.


WF 7.6.4, Win XP, SQL 2005
 
Posts: 42 | Location: California | Registered: August 17, 2007Report This Post
Expert
posted Hide Post
Yes, well, you're probably not setting the engine.

Take a look at this:

Crazy DB2 error?


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
The WebFOCUS translator may actually generate that code in the background. Don't have it handy at the moment, but you can run a fex with xtrieval off to see generated code.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Platinum Member
posted Hide Post
I think that goes something like this...

  
SET TRACEOFF = ALL
SET TRACEON = SQLAGGR//CLIENT
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = STMTRACE/2/CLIENT
SET TRACEUSER = ON
SET XRETRIEVAL=OFF



WebFOCUS 8201M/Windows Platform
 
Posts: 109 | Registered: October 31, 2006Report This Post
Silver Member
posted Hide Post
Thanks a lot to everybody who replied. It works and right now I'm under non-negotiable deadline for this project, so I really don't have time to explore all suggestions. I found that on page 21-3 of "Creating reports with WebFocus language" it says that '||' should be used for concatenation, so I had to read manual. I just assumed that if it is called 'SQL Translator' then it should translate any query which runs in SQL.
Thanks again to everybody.


WF 7.6.4, Win XP, SQL 2005
 
Posts: 42 | Location: California | Registered: August 17, 2007Report This Post
Member
posted Hide Post
TRY (DEPENDING ON YOUR NEEDED FORMAT WITH OR WITHOUT SPACE) THE FOLLOWING:

DEFINE FILE TALERTS_SENT
FMT_JNUM/A43 = JOB_NUMBER||(' '|FMT_SENTTO);
FMT_JNUM/A42 = JOB_NUMBER||FMT_SENTTO;
END
.
.
.

IRA WF 5.3.6
 
Posts: 29 | Registered: March 30, 2007Report 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     OPERATOR + INCOMPATIBLE WITH OPERANDS

Copyright © 1996-2020 Information Builders