Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: datatypes
Imran,
what I do is the following:
create table temp_table as select primary_key_column, number_column from table_to_be_changed;
update table_to_be_changed
set number_column=null;
alter table_to_be_changed modify(number_column(3,2));
declare
cursor c1 is
select primary_key_column, number_column
from temp_table;
begin
for c1_rec in c1 loop
update table_to_be_changed
set numebr_column = c1_rec.number_column where primary_key_column = c1_rec.primary_key_column;end loop;
commit;
end;
/
Hope this helps.
Tom Mercadante
Oracle Certified Professional
-----Original Message-----
Sent: Thursday, May 02, 2002 9:39 AM
To: Multiple recipients of list ORACLE-L
Perhaps:
Export, truncate table, alter table, import
or
Create <temp_table> as select * from <orig_table>,
truncate table <orig_table>,
alter table<orig_table>,
insert from <temp_table>,
drop <temp_table>
Imran Ashraf <imran9a_at_yahoo.com>@fatcity.com on 02-05-2002 14:18:28
Please respond to ORACLE-L_at_fatcity.com
Sent by: root_at_fatcity.com
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc:
Hi,
i have a column set to number(3). However this needs to be changed to number (3,2). But i cannot do a straight alter table as there is data in the column.
how can i get round this?
cheers
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Liststo: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
INET: rchalton_at_dunnes-stores.ie
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Liststo: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Liststo: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu May 02 2002 - 09:08:23 CDT
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message