With SQL Naming conventions the default schema for unqualified specified
database objects in static SQL statements is resolved at compile time. A
default schema can only be set through the compile option (or SET OPTION)
DFTRDBCOL.
For dynamic SQL it depends on the DYNDFTCOL option whether the same default
schema as for static SQL statements or whether the default schema at runtime
is used.
When using System Naming conventions, the library list at runtime is used,
but if a database object is created without schema qualification, the QGPL
library is used.
For more information about SQL and System Naming in composition with
unqualified objects you may read the following articles:
System versus SQL Naming - Part 1
http://www.ibm.com/developerworks/ibmi/library/i-sqlnaming/index.html
System versus SQL Naming - Part 2
http://www.ibm.com/developerworks/ibmi/library/i-system_sql2/index.html
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Charles Wilt
Sent: Dienstag, 10. Januar 2017 00:19
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Create table with unqualified table name not going into
CURRENT_SCHEMA
SQL embedded in RPGLE,
I'm doing a
exec sql SET SCHEMA :newSchema;
Prior to a SQL statement that creates a new table.
I'd expect the table to be in the schema specified by the variable newSchema
(MYLIB).
However it's not being created there.
With SQL naming, it goes into QDFTOWN
With system naming, it goes into QGPL.
The only other setting I'm aware of that might affect this is, DFTRDBCOL;
but that is set DFTRDBCOL(*NONE).
What am I missing?
Charles
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-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.