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     [SOLVED] Remote SQL Query output format

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Remote SQL Query output format
 Login/Join
 
Guru
posted
Is it possible to get the result of a remote sql query to output in excel/pdf format?

I've been trying the following program but it seems that it is ignoring the SQLOUT and PCHOLD and just displaying the result of the SELECT statement.

-*Remote FOCUS mainframe  
REMOTE DEST=MVS436

-MRNOEDIT BEGIN
-REMOTE BEGIN

SET SQLENGINE=DB2
SQL DB2
SELECT * FROM DSN.AMNAPPRV              
FETCH FIRST 5 ROWS ONLY;                                           
END
-RUN

TABLE FILE SQLOUT
PRINT *
ON TABLE PCHOLD
END
-RUN
-REMOTE END
-MRNOEDIT END

TABLE FILE HOLD
PRINT *
ON TABLE PCHOLD FORMAT EXL2K
END

This message has been edited. Last edited by: Mighty Max,


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Virtuoso
posted Hide Post
Try this:

REMOTE DEST=MVS436

-MRNOEDIT BEGIN
-REMOTE BEGIN

SET SQLENGINE=DB2
SQL
SELECT * FROM DSN.AMNAPPRV              
FETCH FIRST 5 ROWS ONLY;                                           

TABLEF
ON TABLE HOLD
END
-RUN
-REMOTE END
-MRNOEDIT END

TABLE FILE HOLD
PRINT *
ON TABLE PCHOLD FORMAT EXL2K
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Guru
posted Hide Post
Dan,
I ran your code and got this error.
  
 HOLDING...
 NUMBER OF RECORDS IN TABLE=        5  LINES=      5
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HOLD
 BYPASSING TO END OF COMMAND


So it looked like the hold was working but webfocus could not find the master for the hold file.
Did some tinkering to the code and got it to work. Here is the code.
  
REMOTE DEST=MVS436

-MRNOEDIT BEGIN
-REMOTE BEGIN

SET SQLENGINE=DB2
SQL
SELECT * FROM DSN.AMNAPPRV              
FETCH FIRST 5 ROWS ONLY;                                           

TABLEF
ON TABLE HOLD
END
-RUN

TABLE FILE HOLD
PRINT *
ON TABLE PCHOLD
END
-RUN

-REMOTE END
-MRNOEDIT END

TABLE FILE HOLD
PRINT *
ON TABLE PCHOLD FORMAT EXL2K
END
-EXIT

Thanks for the help. I would have been completely lost without it.


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Virtuoso
posted Hide Post
I'm glad you got it working. You might also try changing the ON TABLE HOLD to ON TABLE PCHOLD (as in your initial post) to see if you can eliminate the second TABLE request.

REMOTE DEST=MVS436

-MRNOEDIT BEGIN
-REMOTE BEGIN

SET SQLENGINE=DB2
SQL
SELECT * FROM DSN.AMNAPPRV              
FETCH FIRST 5 ROWS ONLY;                                           

TABLEF
ON TABLE PCHOLD
END
-RUN

-REMOTE END
-MRNOEDIT END

TABLE FILE HOLD
PRINT *
ON TABLE PCHOLD FORMAT EXL2K
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report 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     [SOLVED] Remote SQL Query output format

Copyright © 1996-2020 Information Builders