CREATE TABLE <..> AS (SELECT <...>)
Isn't designed to create an exact duplicate, ie. CRTDUPOBJ, as far as I
Certainly, you'd want the copy options
INCLUDING IDENTITY COLUMN ATTRIBUTES
INCLUDING COLUMN DEFAULTS
INCLUDING IMPLICITLY HIDDEN COLUMN ATTRIBUTES
INCLUDING ROW CHANGE TIMESTAMP COLUMN ATTRIBUTES
You might also try
CREATE TABLE DUPTABLE LIKE ORIGTABLE
The CREATE LIKE syntax has the following note:
If the LIKE clause is specified immediately following the table-name and not
enclosed in parenthesis, the following column attributes are also included,
otherwise they are not included (the default value, identity, row change
timestamp, and hidden attributes can also be controlled by using the
v Default value, if a table-name is specified (view-name is not specified)
v Hidden attributes
v Identity attributes
v Column heading and text (see “LABEL” on page 1164)
The implicit definition does not include any other optional attributes of
identified table or view. For example, the new table does not automatically
include primary keys, foreign keys, or triggers. The new table has these and
other optional attributes only if the optional clauses are explicitly
If the specified table or view is a non-SQL created physical file or
any non-SQL attributes are removed. For example, the date and time format
will be changed to ISO.
On Fri, Mar 1, 2013 at 12:23 PM, Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx>wrote:
I have looked around some, to find a solution. We have a process that is
creating a duplicate of a table with selected columns into QTEMP. The
table has a couple timestamps, otherwise it is all ZONED and ALPHA.
One of the timestamps is a ROW CHANGE TIMESTAMP.
The format level ID is not the same as the table used in the SELECT.
Both objects are SQL tables, so it's not a matter of one is an SQL
object and the other is not.
Now to have a simple example, I tried it with QIWS/QCUSTCDT, and the
result is the same.
create table qtemp/mytest as (SELECT * FROM qiws/qcustcdt) with no
Fmt lvl ID for QCUSTCDT is 3B84438D4C428
Fmt lvl ID for MYTEST is 449C8BB02A248
At this time we are doing a single-record CPYF, then some overrides,
then an INSERT with OVERRIDING SYSTEM VALUE clause.
Is this just the way it is, or is there a PTF to take care of this? I do
not yet have access to PTF info here. We ARE at 7.1 of the OS.
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,
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
This mailing list archive is Copyright 1997-2013 by MIDRANGE dot 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 here. If you have questions about this, please contact