I thought about the *SYS vs *SQL but wouldn't an update library1/file1 fail?
Wouldn't it have to be update library1.file1 (period instead of slash
separating)? When I hardcoded the library, I used library1/file1 and it
worked.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Buck
Calabro
Sent: Tuesday, November 28, 2017 4:34 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: SQL with connections to multiple databases
On 11/28/2017 4:00 PM, John R. Smith, Jr. wrote:
So, since the object is found via the DSPOBJD command and the library the
DSPOBJD command finds it in is the one that I hardcoded why would the update
statement works with the library hardcoded but fail if it is omitted?
Wild guess: Naming has been changed from *SYS to *SQL by program B. See
exec sql SET OPTION. With *SQL, unqualified table names use the user ID as
the implied qualifier. At least this is testable by creating a library
named the same as your user ID, putting a copy of FILE1 in there, and seeing
if that works.
Some additional debugging information might be available in the special
registers:
CURRENT_PATH
CURRENT_SCHEMA
CURRENT_SERVER
SYSTEM_USER
Database > Programming > SQL programming > Data manipulation language >
Retrieving data using the SELECT statement
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/sqlp/rbafyspecreg.h
tm
--
--buck
http://wiki.midrange.com
Your updates make it better!
--
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
As an Amazon Associate we earn from qualifying purchases.