Re: CREATE TABLE AS - not materialized?
"Bruce" <sandell@pacbell.net> wrote in message
news:595024a5.0406081853.14ff32bc@posting.google.c om...
> I want to create a new table based on an existing table, but I don't
> want the tables to have any enforced relationship. Is this possible
> without having to do a CREATE TABLE and an INSERT?
>
> create table customer_Temp
> as (select credit_Card_number, personal_id_number from customer)
> DATA INITIALLY DEFERRED REFRESH deferred;
>
> refresh table customer_temp;
>
>
>
> But when I tried to rename "customer", it returns the following:
>
> db2 => rename table customer to customer_new;
> DB21034E The command was processed as an SQL statement because it was
> not a
> valid Command Line Processor command. During SQL processing it
> returned:
> SQL0750N The source table cannot be renamed because it is referenced
> in a
> view, materialized query table, trigger, SQL function, SQL method,
> check
> constraint, or referential constraint. SQLSTATE=42986
> db2 =>
These are called MQT (materialized query tables) so they are materialized.
You can create a regular table and then do the following so they are not
connected:
insert into customer_Temp select credit_Card_number, personal_id_number from
customer
see the SQL Reference for details. |