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] Executing SQL

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Executing SQL
 Login/Join
 
Virtuoso
posted
I wrote a simple fex to execute me some SQL on our DB2/400. Executing basic queries works fine, but as soon as I attempt to format them I'm getting strange errors...

What works is this:
APP HOLD SQLREPORTS

ENGINE DB2 SET DEFAULT_CONNECTION SQL400
SQL
&QUERY
END
-RUN


But if, in an attempt to format the output, I change that so that the output is passed on to an SQLOUT table:
APP HOLD SQLREPORTS

ENGINE DB2 SET DEFAULT_CONNECTION SQL400
SQL DB2 PREPARE SQLOUT FOR
&QUERY
END
-RUN

TABLE FILE SQLOUT
PRINT *
END
-RUN


I get this:
 APP HOLD SQLREPORTS
 ENGINE DB2 SET DEFAULT_CONNECTION SQL400
 SQL DB2 PREPARE SQLOUT FOR
 SELECT * FROM caldat8 WHERE CALYEA = 11 AND CALMNT = 1;
 END
 -RUN
 (FOC1261) PHYSICAL INTERFACE NOT FOUND FOR SUFFIX DB2. MODULE NAME : RRSET
 (FOC1262) THE FOLLOWING NATIVE ERROR MESSAGE(S) CAPTURED :
 (FOC1260) SearchPath: failed to find C:\ibi\DEVSTU~1\srv76\home\bin\rrset.dll
 (FOC1400) SQLCODE IS -1 (HEX: FFFFFFFF)
 (FOC1488) SQL INTERFACE HAS NOT BEEN INSTALLED OR COULD NOT BE INITIALIZED
 : Physical interface not found for SUFFIX=DB2     . Module name: RRSET
 (FOC1400) SQLCODE IS -1 (HEX: FFFFFFFF)
 (FOC1488) SQL INTERFACE HAS NOT BEEN INSTALLED OR COULD NOT BE INITIALIZED
 : Physical interface not found for SUFFIX=DB2     . Module name: RRSET
 (FOC1479) ERROR CONNECTING TO SQL DATABASE
 TABLE FILE SQLOUT
 PRINT *
 END
 -RUN
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SQLOUT
 BYPASSING TO END OF COMMAND


Can anyone explain what is going on here and how to fix this?

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
Expert
posted Hide Post
Since you do not specify the engine ("SQL SELECT..."), the first SQL request actually uses the WebFOCUS metadata, which appears to work.

You specify the SQL engine in the second ("SQL DB2 SELECT..."), and it appears your DevStudio reporting server is not configured correctly (though I have not seen messages like these).

Even though you set the default connection, you also must specify the engine type in your SQL statement. An alternative to SQLOUT is TABLE ON TABLE..., something like this:

ENGINE DB2 SET DEFAULT_CONNECTION &CONNECTION_NAME

SQL DB2
SELECT TABSCHEMA, TABNAME FROM SYSCAT.TABLES
ORDER BY TABSCHEMA, TABNAME
;
TABLE ON TABLE HOLD AS HOLD01
END
-RUN


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
Thanks for that Francis!

I found that I can execute my queries from the command console, provided I select the server with the DB2 connector as the location to run the queryfrom (I also just noticed a spelling error in the contents of that dropdown, where it says "WebFOCUS enviroments").

That kind of throws a stick in the wheels for creating an easy to access query tool from within WebFOCUS...


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
If you can run the SQL from the command console of the reporting server console, you should be able to run it from a fex on that same server. You can access the fexes in the application directories directly from the reporting server console - try running it from the Procedures link.


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:
If you can run the SQL from the command console of the reporting server console, you should be able to run it from a fex on that same server.


That's exactly what I was trying to circumvent.
A fex to execute arbitrary SQL statements does not belong on a production server IMHO...

I'm trying to have this SQL query "tool" on my local development environment, but it would appear that's impossible then.

I guess I should look for a 3rd party DB2/400 query tool with good copy/paste support (should be able to handle different line-ending styles, for example).


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
quote:
A fex to execute arbitrary SQL statements does not belong on a production server IMHO...

Wrong. Quite often a business problem is solved better with SQL passthru statements than with WebFOCUS code.


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
  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] Executing SQL

Copyright © 1996-2020 Information Builders