Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> COPY vs. INSERT - another reply

COPY vs. INSERT - another reply

From: Milan Rahman <milan_rahman_at_MailAndNews.com>
Date: Tue, 30 May 2000 10:35:53 -0400
Message-Id: <10513.107103@fatcity.com>


Unless I am not using the SQLPLUS COPY utility properly, here is an example of what the implicit conversion to DECIMAL(38) does to your data.

create table milan_a (a_number NUMBER, b_number_prec NUMBER(5,2))

insert into milan_a values (2.9, 1.07);

commit;

copy from xxx/xxx_at_db1 to xxx/xxx_at_db2 -
> create milan_b using select * from milan_a;

Array fetch/bind size is 15. (arraysize is 15) Will commit when done. (copycommit is 0) Maximum long size is 80. (long is 80)
Table MILAN_B created.

   1 rows selected from xxx_at_db1.
   1 rows inserted into MILAN_B.
   1 rows committed into MILAN_B at xxx_at_db2.

SQL> select * from milan_b;

A_NUMBER B_NUMBER_PREC
-------- -------------

    3.00 1.07

SQL> select * from milan_a;

A_NUMBER B_NUMBER_PREC
-------- -------------

    2.90 1.07

SQL> desc milan_a

 Name                            Null?    Type
 ------------------------------- -------- ----
 A_NUMBER                                 NUMBER
 B_NUMBER_PREC                            NUMBER(5,2)

SQL> desc milan_b
 Name                            Null?    Type
 ------------------------------- -------- ----
 A_NUMBER                                 NUMBER(38)
 B_NUMBER_PREC                            NUMBER(5,2)

As you can see, my original 2.90 is now 3.00...obviously an issue that all users of the utility must know. Received on Tue May 30 2000 - 09:35:53 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US