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     SQL Passthough problem

Read-Only Read-Only Topic
Go
Search
Notify
Tools
SQL Passthough problem
 Login/Join
 
Member
posted
We have WebFOCUS running on an iSeries reporting server which has a passthough connection to a second iSeries. I see these as configured DB2 Cli adapters *LOCAL and AG12.

I'm trying to retrieve 2 sets of data from AG12 using stored procedures. Here's my code

SQL DB2 SET DEFAULT_CONNECTION AG12

SQL DB2 EX AGPRDDTA/USA_WF_11_13_RETRIEVE_BRANCHES(NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-RUN

TABLE FILE SQLOUT
PRINT *
IF READLIMIT EQ 5
END
-RUN

SQL DB2 EX AGPRDDTA/USA_WF_11_13_RETRIEVE_DEPT_CAT(NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-RUN

TABLE FILE SQLOUT
PRINT *
IF READLIMIT EQ 5
END
-RUN

I get 5 records from the first enquiry but messages
< !--
(FOC1400) SQLCODE IS -501 (HEX: FFFFFE0B)
: [24501] Cursor SQLCURSOR000000002 not open.
(FOC1407) SQL FETCH CURSOR ERROR. : SQLOUT
-->
from the second.

If I swap the two calls around, I still get 5 from the first and an error on the second.

It looks like I need a piece of syntax to close the first enquiry down.

I've been trying all afternoon - anyone with any ideas please?


WebFocus 7.6.11
IBM iSeries
 
Posts: 14 | Location: Leeds, England | Registered: May 16, 2005Report This Post
Gold member
posted Hide Post
Try adding an 'END' before the '-RUN' in each of your stored procedure calls:

SQL DB2 EX AGPRDDTA/USA_WF_11_13_RETRIEVE_BRANCHES(NULL,NULL,NULL,NULL,NULL,NULL,NULL);
END
-RUN


WebFOCUS 7.7.02
Unix
All Output
 
Posts: 70 | Registered: March 24, 2011Report This Post
Expert
posted Hide Post
None of the SQL passthrough requests in my archive have an END between the SQL command and the TABLE FILE SQLOUT command - they are really part of one SQL passthrough statement.

To eliminate possible problems with the procedure AGPRDDTA, have you tried a simple SQL passthrough request, something like:

SQL DB2 SET DEFAULT_CONNECTION AG12
SQL DB2
SELECT
SYSCAT.TABLES.TABSCHEMA
FROM
SYSCAT.TABLES
FETCH FIRST 10 ROWS ONLY;
TABLE FILE SQLOUT
PRINT *
END

There are two iseries computers involved, which suggests a remote connection, and that may different syntax...


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
Member
posted Hide Post
Hi

Thanks for the 2 replies

We've been trying all sorts of things this afternoon and a colleague of mine has resolved this, simply by removing the "-RUN"s that occur immediately after the SQL.

See the following with the *RUN commented out.

Note that the original code all worked where the data was on the same machine as reporting server, it was only when passing through that the second and subsequent SQL calls gave the error.


SQL DB2 SET DEFAULT_CONNECTION AG12

SQL DB2 EX AGPRDDTA/USA_WF_11_13_RETRIEVE_BRANCHES(NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-* -RUN

TABLE FILE SQLOUT
PRINT *
IF READLIMIT EQ 5
END
-RUN

SQL DB2 EX AGPRDDTA/USA_WF_11_13_RETRIEVE_DEPT_CAT(NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-* -RUN

TABLE FILE SQLOUT
PRINT *
IF READLIMIT EQ 5
END
-RUN


WebFocus 7.6.11
IBM iSeries
 
Posts: 14 | Location: Leeds, England | Registered: May 16, 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     SQL Passthough problem

Copyright © 1996-2020 Information Builders