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] Can you do sql passthru to a Remote Server?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Can you do sql passthru to a Remote Server?
 Login/Join
 
Platinum Member
posted
Is it possible to do sql passthru to a Remote Server? I am not able to figure it out and cant really find any documentation on it. We have remote servers configured but dont know how to pass sql. Can someone please help me or point me in the right direction.



Thanks,
prodrigu

This message has been edited. Last edited by: <Kathryn Henning>,


Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
 
Posts: 121 | Location: California | Registered: June 19, 2008Report This Post
Expert
posted Hide Post
Yes you can.

You need to use the REMOTE commands.

e.g.
REMOTE DEST ASUK2
-RUN
-REMOTE BEGIN
.
.
.
Code including SQL
.
.
.

-REMOTE END


If you need to pass back info, use PCHOLD


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Waz:
If you need to pass back info, use PCHOLD


Or HOLD it locally (on the remote server) and on the local server create a synonym to it.

Unfortunately the CREATE SYNONYM command isn't documented, but there are some posts in these forums outlining how to use it.


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
Platinum Member
posted Hide Post
Waz,

Below is the what I am trying to do but I am getting an error message. Can you please help?

REMOTE DEST ASTSTSUB
-RUN

-REMOTE BEGIN

SELECT DISTINCT
IMLITM,
IMDSC1
FROM F4101
WHERE SUBSTRING(IMGLPT,1,1) = 'F'
ORDER BY 1;

-REMOTE END

TABLE FILE SQLOUT
PRINT *
END
-EXIT  


Error Message:
  
 -INCLUDE sqlpass_remote_server_jde.fex
 -* File sqlpass_remote_server_jde.fex
 REMOTE DEST ASTSTSUB
 -RUN
 (FOC32071) REMOTE SET REQUIRES EQUAL SIGN
 -REMOTE BEGIN
 SELECT DISTINCT
 IMLITM,
 IMDSC1
 FROM F4101
 WHERE SUBSTRING(IMGLPT,1,1) = 'F'
 ORDER BY 1;
 -REMOTE END
 (FOC1517) UNRECOGNIZED COMMAND SELECT DISTINCT
 (FOC1517) UNRECOGNIZED COMMAND IMLITM,
 (FOC1517) UNRECOGNIZED COMMAND IMDSC1
 (FOC1517) UNRECOGNIZED COMMAND FROM F4101
 (FOC1517) UNRECOGNIZED COMMAND WHERE SUBSTRING(IMGLPT,1,1) = 'F'
 (FOC1517) UNRECOGNIZED COMMAND ORDER BY 1;
 (FOC1400) SQLCODE IS 1517 (HEX: 000005ED)
 : UNRECOGNIZED COMMAND SELECT DISTINCT
 L    (FOC1405) SQL PREPARE ERROR.
 TABLE FILE SQLOUT
 PRINT *
 END
 -EXIT
 0 ERROR AT OR NEAR LINE     17  IN PROCEDURE sqlpass_remote_ser
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SQLOUT
 BYPASSING TO END OF COMMAND



Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
 
Posts: 121 | Location: California | Registered: June 19, 2008Report This Post
Platinum Member
posted Hide Post
I figured out the first error statement and changed "REMOTE DEST ASTSTSUB" to "REMOTE DEST=ASTSTSUB" and that error went away.


Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
 
Posts: 121 | Location: California | Registered: June 19, 2008Report This Post
Platinum Member
posted Hide Post
Thank you all for your help but I was able to figure it out. Below is my code that allows me to pass sql to a remote server.

REMOTE DEST=ASTSTSUB
-RUN

-REMOTE BEGIN

SQL DB2

SELECT 
F4101.IMLITM,
F4101.IMDSC1
FROM F4101
WHERE SUBSTRING(F4101.IMGLPT,1,1) = 'F'
ORDER BY 1;

TABLE FILE SQLOUT
PRINT *
ON TABLE PCHOLD
END

-REMOTE END

-**************************************************************
-*The following 2 lines depict where the file and its
-*Master will be placed in your APP dirs on your HUB server
-*Any Valid APP dir will work
-**************************************************************

APP HOLD MRODRIGTST

-**************************************************************

TABLE FILE SQLOUT
PRINT *
-*Below the XXXXX is the name you want to give the data file on the HUB
-*The YYYYY is the format you would like to save it in
ON TABLE HOLD AS DATATEST FORMAT FOCUS
END
-EXIT  


Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
 
Posts: 121 | Location: California | Registered: June 19, 2008Report 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] Can you do sql passthru to a Remote Server?

Copyright © 1996-2020 Information Builders