Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Insert into one empty table from another table
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
![]() |
![]() |