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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Insert into one empty table from another table

Re: Insert into one empty table from another table

From: Allen <allen.brost_at_motorola.com>
Date: Mon, 28 Aug 2000 17:28:44 -0500
Message-ID: <39AAE79C.35E383BF@motorola.com>

INSERT INTO emp1

   SELECT empno, ename
   FROM emp_2;

If your coping the tables just to reduce the varchar2(100) to varchar2(50) it would be easier to use an ALTER TABLE statement.

Cheers
Allen

Paul wrote:

> Hi,
> I have one empty table emp_1,
> SQL>desc emp_1;
>
> Name Null? Type
> ------- ------ -------
> EMPNO NOT NULL NUMBER(10)
> ENAME NOT NULL VARCHAR2(50)
>
> Another table is emp_2
>
> SQL>desc emp_2;
>
> Name Null? Type
> ------- ------ -------
> EMPNO NOT NULL NUMBER(10)
> ENAME NOT NULL VARCHAR2(100)
>
> SQL>select count(*) from emp_1;
> COUNT(*)
> -------
> 0
>
> SQL>select count(*) from emp_2;
> COUNT(*)
> --------
> 1000
>
> So, the only different is ENAME is varchar(100); But I want to keep them,
> I only want emp_2 data into emp_1.
>
> Does somebody can give me the SQL script for transfering the data or using
> exp/imp.
>
> Thanks a lot
>
> Paul
>
> --
> Posted via CNET Help.com
> http://www.help.com/
  Received on Mon Aug 28 2000 - 17:28:44 CDT

Original text of this message

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