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;
This won't work if the ename field contains an entry that is longer than 50 characters. Are error will be raised. To copy only the first 50 characters into the new table, try:
INSERT INTO emp_1
SELECT empno, SUBSTR(ename,1,50) 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.
Again, if the column contains data with more than 50 characters, an error will be raised.
HTH,
Brian
-- ======================================== Brian Peasland Raytheons Systems at USGS EROS Data Center These opinions are my own and do not necessarily reflect the opinions of my company! ========================================Received on Tue Aug 29 2000 - 08:08:23 CDT
![]() |
![]() |