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.
We're working with DB2 on an IBM iseries server here, and it appears there is no proper tool to execute arbitrary SQL queries on that. Yes, you can execute strsql from a terminal session, but my god, how inconvenient can IBM make this?!? You get 25 lines of space to paste a query in, it hardly has any inline editing capabilities, the thing is a disaster!
So I was wondering, how hard can it be to create a report where I put my SQL query in a large TEXTAREA and send it to the WebFOCUS client to execute?
Creating the launch page is easy. A client-side procedure that executes an arbitrary SQL command isn't hard either, but retrieving the results is what I get stuck on...
Say, I upload this procedure to the client:
APP HOLD SQLREPORTS
-DEFAULT &ARBITRARYSQL = 'SELECT 1 FROM some_table WHERE 1 = 0';
ENGINE DB2 SET DEFAULT_CONNECTION SQL400
SQL DB2 PREPARE SQLOUT FOR
&ARBITRARYSQL.EVAL
END
-RUN
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS ARBITRARYSQLOUTPUT FORMAT FOCUS
END
-RUN
That code creates a master-file (ARBITRARYSQLOUTPUT.mas) that defines the format of the results. However, that result differs per query that I send to this fex! How to handle that?
Perhaps there are better suggestions for tools to send arbitrary SQL to this database server?This message has been edited. Last edited by: Wep5622,
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 :
You will need to build a launch page for entering the SQL and running the procedure, but it should work.
The only issue I can think of is passing multiple line out of a text area.
Will the carriage returns cause any issues with the assignment of the & variable.
I think I have done similar in the past (don't know where the code is), and at the time, had to use javascript to break up the textarea into multiple variables, then use a loop to put them in the code.
.... Yes, you can execute strsql from a terminal session, but my god, how inconvenient can IBM make this?!? You get 25 lines of space to paste a query in, it hardly has any inline editing capabilities, the thing is a disaster!
So I was wondering, how hard can it be to create a report where I put my SQL query in a large TEXTAREA and send it to the WebFOCUS client to execute?
You can use iSeries Navigator or other tools like Squirrel using an ODBC/OLE DB or JDBC driver. No need green screen.
WebFocus 7.7 (DB2 Web Query 1.1.2). IBM i
Posts: 11 | Location: France | Registered: January 13, 2012
Thanks for mentioning those tools. I had actually looked at both before, but concluded they weren't capable of connecting to a DB2 database.
Who would have thought that iSeries Navigator could send SQL queries to the DB? I just need to figure out how that's supposed to work, as it isn't obvious from the interface at all. Or perhaps our version 5 release 3 can't?
I think Squirrel is probably the better option, once I can figure out what JDBC connect-string I need to use. I did manage to beat IBM's attempts to hide the JDBC driver, let's hope they didn't put up more challenges...
@Waz: I hadn't realised that newlines in the text area could cause problems in interpreting the variable's contents. Thanks for mentioning that.
The problem I'm facing though is not getting the query to the database, but getting the results back. You need to TABLE FILE SQLOUT to generate a result set on the database server, for which you need a local master file to query the result set from WebFOCUS. That master file would have different contents for each query though, it's never going to be up-to-date. How do you handle that?
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 :
Aha, you're calling the adhoc_fex on the remote machine! Yeah, I suppose that would work. Thanks for the suggestion.
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 :
I use iSeries navigator to run sql against an iseries server every day of the week. There's a little trick to bring up a window that allows you to type in sql statements. Just expand your scheme (called library in iseries), expand "tables" then at the bottom pane of that window in blue letters is a link to "Run an SQL Script" click on that and it brings up a window.
Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
Hmm... We must have a different version: On each "Connection" I only get "Basic Operations" and "File Systems" - no "Library".
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 :
It looks like the SQL plug-in is not available from our AS400 servers.
Fortunately, a colleague helped me set up a system ODBC connection, with which I succeeded in setting up Squirrel! Things like these are hard to get right when you're not very familiar with either Windows or AS400...
Thanks for the pointers!
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 :