× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 13-Oct-2015 15:29 -0600, Charles Wilt wrote:
On Tue, Oct 13, 2015 at 4:16 PM, JRusling wrote:

[...] when connected to prod, i can't seem to reference the dev
(local) box.

for instance, i tried 3 part naming like below

insert into dev/jrpers/log
select * from prod/jrpers/log

this yields "Statement references objects in multiple databases."

It's sort of like - while connected to prod, from dev, access to
the dev data files is unavailable to me. I've got to be missing
some piece to the puzzle.
[..]

Pretty sure that isn't supported...

what you can do is

create tmptbl as
(select * from prod.jrpers.log)
with data


The INSERT INTO local_table_reference statement is supported for use with a subselect that accessed\obtains data from an implicit connection to a remote database by specification of three-part naming to just one remote database. There is no need to force the data to be written to a [GLOBAL TEMPORARY] TABLE by using a SELECT query encapsulated in a CREATE TABLE statement... if that is what was intended to be alluded.

[http://www.ibm.com/support/knowledgecenter/api/content/ssw_ibm_i_72/sqlp/rbafyremoteins.htm]
_Inserting data from a remote database_
"You can insert into a table on the local server using a select statement to get rows from a remote server.

To insert all the rows from the SALES table on REMOTESYS for sales made yesterday, use the following statement:

INSERT INTO SALES
(SELECT * FROM REMOTESYS.TESTSCHEMA.SALES WHERE SALES_DATE = CURRENT DATE - 1 DAY)

DB2® for i will connect to REMOTESYS to run the SELECT, return the selected rows to the local system, and insert them into the local SALES table. The value for CURRENT DATE will be the current date on REMOTESYS.
..."

Huh! In my prior reply directly to the OP, I forgot to add my typical response [to the seemingly pervasive off-topic posting], that this topic is unrelated to the intent of this forum... which is, the RPG language, about which that SQL inquiry has no relation [even if the intent is eventually to perform that SQL from RPG].


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.