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     Case Logic in SQL Passthrough Problem

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Case Logic in SQL Passthrough Problem
 Login/Join
 
Guru
posted
Confused
When I run a case logic statement through the MS SQL Query everything checks out. However, when I use the logic in SQL Passthrough I get the NASTY MESSAGE noted below:
SET SQLENGINE=SQLMSS
SQL SQLMSS
Select
[Sales Rep Rep Code] AS REPCODE
, [Sales Rep Last Name] AS LAST_NAME
, [Sales Rep First Name] AS FIRST_NAME
, DBA
, ReferralDate AS REFERRALDATE
, StatusDate AS STATUSDATE
, [Current Status] AS CURRENT_STATUS
, ReferralID AS REFERRALID
, PROBABILITY = Case when [Current Status] in ('Approved','Credit Review')
then 'HIGH'
when [Current Status] in
('Dead Lead','Declined','Do Not Call- DNS List Verified', 'Duplicate Lead')
then 'LOW'
else 'MEDIUM' end
, Sum(GrossSales) AS GROSS_SALES
, Sum(AnnualCardVolume) AS ANNUAL_VOLUME
from dbo.tblReferralData
Where ReferralDate between '2006/04/01' and '2006/04/30'
and PROBABILITY = 'HIGH'
Group by
[Sales Rep Rep Code] AS REPCODE
, [Sales Rep Last Name] AS LAST_NAME
, [Sales Rep First Name] AS FIRST_NAME
, DBA
, ReferralDate AS REFERRALDATE
, StatusDate AS STATUSDATE
, [Current Status] AS CURRENT_STATUS
, ReferralID AS REFERRALID
Order by StatusDate DESC
;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS HOLDA FORMAT FOCUS INDEX REPCODE
END
-RUN
-* NOTE THE NASTY MESSAGE
(FOC1400) SQLCODE IS 207 (HEX: 000000CF) XOPEN: 42S22
: Microsoft OLE DB Provider for SQL Server: [42S22] Invalid column name 'P
: ROBABILITY'. [42S22] Invalid column name 'PROBABILITY'. [42000] Statemen
: t(s) could not be prepared. [] Deferred prepare could not be completed.
L (FOC1405) SQL PREPARE ERROR.

Frowner


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL
 
Posts: 238 | Location: Atlanta, GA/Rehovot, Israel | Registered: May 06, 2003Report This Post
Guru
posted Hide Post
Can you reference PROBABILITY in the where statement? In Oracle SQL it always gives me problems when I do that.

Shouldn't your where look like this:
Where ReferralDate between '2006/04/01' and '2006/04/30'
and [Current Status] in ('Approved','Credit Review')
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
Guru
posted Hide Post
Thanks - should have thought of that but I still wish I could get an explanation on the SQL error.


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL
 
Posts: 238 | Location: Atlanta, GA/Rehovot, Israel | Registered: May 06, 2003Report This Post
Guru
posted Hide Post
I normally don't create/test my SQL in dev studio. I use a tool like SQL Plus or TOAD.
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
Expert
posted Hide Post
Hi Sandy,

Try this syntax for case logic in MSSSQL via WF -

Case when [Current Status] in ('Approved','Credit Review')
then 'HIGH'
when [Current Status] in
('Dead Lead','Declined','Do Not Call- DNS List Verified', 'Duplicate Lead')
then 'LOW'
else 'MEDIUM' end as PROBABILITY


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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     Case Logic in SQL Passthrough Problem

Copyright © 1996-2020 Information Builders