Since you verified &2 is in your library list, did you verify &1 of type &3 exists in &2? Even if &1 exists, the system is expecting it to be of type &3 and perhaps it's not of type &3.

Coy Krill
Core Processing Administrator/Analyst
Washington Trust Bank

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of John R. Smith, Jr.
Sent: 2017 November 22 13:15
To: 'RPG programming on the IBM i (AS/400 and iSeries)' <rpg400-l@xxxxxxxxxxxx>
Subject: RE: SQL with connections to multiple databases
Importance: Low

I originally thought my problem was a remote connection not getting closed/disconnected but apparently that is not the problem. I am very confused on what is causing it or how to find it so I am reaching out for ideas. Here is what I know.

-- I am consulting for a company that sells a product and one of their customer is having a problem with it.
-- I do not have access to the customer's machine so I can't debug this.
-- The product's program (call it Program A) is calling a customer's program (call it program B) which is doing a remote database connection.
-- When program B ends, program A calls a function in a service program that attempts to update a record in the database on the local machine but fails with SQL0204 - &1 in &2 type *&3 not found.
-- I have made several "patch versions" of both program A and the service program and have found the following (via DSPJOB and other messages manually and systematically sent to the joblog).
-- The library containing the file to be updated is in the library list.
-- Immediately before the SQL update I added a "EXEC SQL CONNECT".
According to %subst(SQLERRMC:1:18), the database connection is the local machine.
-- I added "EXEC SQL ROLLBACK", "EXEC SQL CONNECT RESET", and another "EXEC SQL CONNECT". I added the rollback because I found on the web that you can't do connection reset with pending updates so I added it just in case that was correct. The additional "EXEC SQL CONNECT" and checking the value again after the "EXEC SQL CONNECT RESET" was a "I'm getting desperate so I'll try anything".

Can someone provide other debugging ideas, commands, or variables in program A or the service program that I can look at to see what is going on? I am completely lost.

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD


---------------------------------------------------------------------
This electronic mail message and any attachments may contain confidential or privileged information and is intended for use solely by the above-referenced recipient. Any review, copying, printing, disclosure, distribution, or other use by any other person or entity is strictly prohibited under applicable law. If you are not the named recipient, or believe you have received this message in error, please immediately notify the sender by replying to this message and delete the copy you received

---------------------------------------------------------------------


This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2019 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].