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 <[EMAIL PROTECTED]>@fatcity.com on 02-05-2002 14:18:28

Please respond to [EMAIL PROTECTED]

Sent by:  [EMAIL PROTECTED]


To:   Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
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

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Imran Ashraf
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (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).



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Mercadante, Thomas F
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (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).

Reply via email to