I have a situation on 7.2 where I want to create a view without
qualifying the name. That is, I want to use the library list. I've
read the documentation at
http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/db2/rbafzqualun1.htm
which says 'For system naming, the default schema is the job library
list (*LIBL).'
I don't know what that means.
cl: chglibl (libsql1 libsql2);
-- this goes into QGPL
create table table_master
(id int,
text char(25));
-- this goes into LIBSQL1
create view view_zero
(id, text)
as (select id, text from table_master);
-- make a child table in a different library in *LIBL
create table libsql2.table_child2
(id int,
text char(25));
-- this goes into LIBSQL2
create view view_two_subselect
(m_id, m_text, c_id, c_text)
as (select m.id, m.text, m.foreign_key, (select text from table_child2)
from table_master m);
Three separate CREATE statements, three separate destinations. Is there
a reference for what is supposed to happen?
This came up because a colleague is convinced that CREATE VIEW with an
unqualified view name will put the new view into the first library in
the library list. He determined this empirically some years ago, and
got surprised today that his script put a new view farther down in the
*LIBL.
Full example script at
http://code.midrange.com/c28c3aef48.html
As an Amazon Associate we earn from qualifying purchases.