Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003

    Thumbs up Unanswered: COPY Command to same schema..possible?

    We are testing set of scripts which we have to use it at client site. But, unfortunately currently we are not having two schemas/DBs to test the same. So we are coping the table info to some other table in the same schema. Is it possible to use the COPY FROM ..TO..USING command to the same schema??

    I tried, but i am getting errors saying "ORA-00900: invalid SQL statement"

    Is anyone help me regarding this..


  2. #2
    Join Date
    Sep 2002
    Provided Answers: 1
    Yes you can:
    SQL> copy from tandrews/xxxxxx@irbproc create emp2 using select * from emp
    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 EMP2 created.
       14 rows selected from tandrews@irbproc.
       14 rows inserted into EMP2.
       14 rows committed into EMP2 at DEFAULT HOST connection.
    SQL> desc emp2
     Name                            Null?    Type
     ------------------------------- -------- ----
     EMPNO                           NOT NULL NUMBER(4)
     ENAME                                    VARCHAR2(10)
     JOB                                      VARCHAR2(9)
     MGR                                      NUMBER(4)
     HIREDATE                                 DATE
     SAL                                      NUMBER(7,2)
     COMM                                     NUMBER(7,2)
     DEPTNO                                   NUMBER(2)
    I don't often use COPY: is there any reason why using it here would be preferable to:
    create table emp2 as select * from emp;

  3. #3
    Join Date
    Jun 2004
    Liverpool, NY USA
    No reason why it shouldn't work. I have used it to copy rows from one schema to another when I didn't want to do a grant on the users to allow the select.
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts