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 SQL function and syntax reference

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]webfocus SQL function and syntax reference
 Login/Join
 
Platinum Member
posted
Is there a document for Webfocus SQL functions? I can use MAX/MIN/SUM and CASE. But not sure what other function and syntax are supported. For example I need to use ISNULL() or NULLIF() but they are not supported.

Thanks.

This message has been edited. Last edited by: <Emily McAllister>,


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
 
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005Report This Post
Virtuoso
posted Hide Post
They're fully documented here: http://infocenter.informationb...om/wf81rel/index.jsp

search for Null or Missing.

ISNULL I believe is EQ MISSING in WebFOCUS.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
What I mean is the function used in webfocus pseudo SQL like this:

SQL
SELECT FIELDS
FROM MASTER_FILE;
TABLE SQLOUT
ON TABLE HOLD AS...
END

Not the TABLE FILE SYNTAX.

You CAN'T use webfocus functions in webfocus pseudo SQL.


quote:
Originally posted by BabakNYC:
They're fully documented here: http://infocenter.informationb...om/wf81rel/index.jsp

search for Null or Missing.

ISNULL I believe is EQ MISSING in WebFOCUS.


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
 
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005Report This Post
Virtuoso
posted Hide Post
The SQL syntax you're talking about should really be used in pass thru mode which means, you send the native SQL of the RDBMS you're using, and the answer set returned is in memory and can be used by TABLE syntax using a master file called SQLOUT. In the SQL portion you can use whatever syntax your native RDBMS supports.
Here's an example for SQL Server:

ENGINE SQLMSS SET DEFAULT_CONNECTION CON01
SQL SQLMSS PREPARE SQLOUT FOR
SELECT * FROM ORDERS
END
TABLE FILE SQLOUT
SUM
     CNT.CustomerID AS 'COUNT,CustomerID'
BY  LOWEST ShipName
BY  LOWEST OrderID
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Master
posted Hide Post
quote:
...For example I need to use ISNULL()...

Example of using SQL scalar functions in a TABLE FILE command:
-* File ExSQLFunction.fex
-*
-* Set display of null data.  
-*
SET NODATA = NULL
-*
-* Turn on SQL Tracing.
-*
SET TRACEOFF = ALL
SET TRACEON = SQLTRANS
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = SQLAGGR//CLIENT
SET TRACESTAMP = OFF
SET TRACEWRAP = 78
SET TRACEUSER = ON
-RUN
-*
-* Display Special Offers.
-*
DEFINE FILE SPECIALOFFER
 DISPLAY_MAXQTY/I11 = SQL.ISNULL(MAXQTY, 0);
END
TABLE FILE SPECIALOFFER
PRINT DESCRIPTION
      DISCOUNTPCT
      MINQTY
      MAXQTY
      DISPLAY_MAXQTY
ON TABLE SET STYLE *
 INCLUDE=eninformationbuilders_light1.sty,$
ENDSTYLE
END  



This example focexec is running against the AdventureWorks2014 MS SQL Server sample database.

Generated SQL:
SELECT
ISNULL(T1."MaxQty", 0),
T1."Description",
T1."DiscountPct",
T1."MinQty",
T1."MaxQty"
FROM
AdventureWorks2014.Sales.SpecialOffer T1; 




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
 
Posts: 822 | Registered: April 23, 2003Report This Post
Platinum Member
posted Hide Post
quote:
Originally posted by David Briars:
quote:
...For example I need to use ISNULL()...

Example of using SQL scalar functions in a TABLE FILE command:
-* File ExSQLFunction.fex
-*
-* Set display of null data.  
-*
SET NODATA = NULL
-*
-* Turn on SQL Tracing.
-*
SET TRACEOFF = ALL
SET TRACEON = SQLTRANS
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = SQLAGGR//CLIENT
SET TRACESTAMP = OFF
SET TRACEWRAP = 78
SET TRACEUSER = ON
-RUN
-*
-* Display Special Offers.
-*
DEFINE FILE SPECIALOFFER
 DISPLAY_MAXQTY/I11 = SQL.ISNULL(MAXQTY, 0);
END
TABLE FILE SPECIALOFFER
PRINT DESCRIPTION
      DISCOUNTPCT
      MINQTY
      MAXQTY
      DISPLAY_MAXQTY
ON TABLE SET STYLE *
 INCLUDE=eninformationbuilders_light1.sty,$
ENDSTYLE
END  



This example focexec is running against the AdventureWorks2014 MS SQL Server sample database.

Generated SQL:
SELECT
ISNULL(T1."MaxQty", 0),
T1."Description",
T1."DiscountPct",
T1."MinQty",
T1."MaxQty"
FROM
AdventureWorks2014.Sales.SpecialOffer T1; 



It's good to know there is this "SQL.ISNULL()" thing. Is it new from ver 8?

But what I am looking for is the standard functions available in the pseudo SQL code, not the real SQL passthru or pure webfocus syntax.

Pseudo Webfocus SQL is quick and easy when you need to join 2 different data sources. It supports the following syntax as I tested:

FULL JOIN, LEFT JOIN, INNER JOIN
CASE WHEN..ELSE..END
SUM(), MAX(), MIN()
GROUP BY

with the limitation of:

1. Can only join on one field, if neither source is a relational database (SQL, DB2, Oracle...);

2. Does not support sub query, like

..WHERE A IN (SELECT B FROM TABLE_B).

I also have trouble comparing dates in pseudo SQL.


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
 
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005Report This Post
Guru
posted Hide Post
Which vendor do you belong bug?


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Report 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 SQL function and syntax reference

Copyright © 1996-2020 Information Builders