On 09-Oct-2015 12:33 -0600, Rob wrote:
<<SNIP>>

I send the team a message explaining I was getting errors.

select count( * ) from KWCBASE

SQL State: 42704
Vendor Code: -204
Message:
[SQL0204] --TABLENAME-- in --USERNAME-- type *FILE not found.
<<SNIP>>

The reply:

[...]. The second attempt that returned SQL state code 42704 means
that the resource being accessed does not exist. Looking at the rest
of the log for that entry it looks like you where trying to access
KWCBASE in library RCOUCH. I know with the navigator SQL and just db2
in general if you do not specify the library it uses your user
profile as the library name. You should be able to set the library to
KWDB108 or qualify the table, i.e. KWDB108/KWCBASE, to run queries
against it.

Unqualified table-references [in dynamic SQL] are implicitly qualified with the Current_Schema. When the Current Schema has not been SET, the default is the authorization-identifier [aka the user profile name] for the session if\when using the *SQL Naming OPTION, and the default is the Library List (*LIBL) if\when using the *SYS Naming OPTION. The NAMING OPTION is established for the database /connection/ for the client feature being used; drill-down into something that is related to the /Database-connection/ to find where to change that attribute, if desired.

The recommendation they offered in "The reply" is quite possibly ineffective, as the slash-character as qualifier is only allowed when System-Naming is in effect. Note that since some point in v7r1 [IBM i 7.1] the dot-character as qualifier is always supported. The results seen suggest likely that the connection had established with the SQL-naming, so specifying KWDB108/KWCBASE will likely result in yet another error; thus, the suggestion to try KWDB108.KWCBASE instead, might be more appropriate.


So how does one select the database...

<<SNIP>>

Not sure what the aim is there, the question nor what was tried [but snipped]. Though maybe...

But if the effect of the connection settings establishing System-naming is either not achieved or is not desired, then perhaps just issue the SET CURRENT SCHEMA KWDB108 if the intention is that any unqualified table-references should refer to a TABLE or VIEW in the library name KWDB108; i.e. if perhaps "how does one select the database" inquires effectively the same as "how does one set the current schema"?


As an Amazon Associate we earn from qualifying purchases.

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-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.