| arun |
Posted: May 01, 2008 02:28:12 AM |
Total Post: 2
Joined: May, 2008
|
hi
Pls help me to convert timestamp(6)to timestamp(2) by running a script so that it effect the whole database where datatype is timestamp(6). And column name is timestamp itself for this datatype (timestamp(6). It should effect on tables and views.
Waiting for reply |
|
|
Murtuja |
| Posted: May 01, 2008 02:43:00 AM | |
|
Total Post: 857
Joined: Jan, 2006
|
Hi,
First understand this query
SELECT * FROM DBA_TAB_COLS WHERE DATA_TYPE = 'TIMESTAMP(6)'
Below query will generate "ALTER TABLE table_name MODIFY column_name column_type;" statements.
SELECT 'ALTER TABLE ' || table_name|| ' MODIFY '|| column_name || ' TIMESTAMP(2);'FROM DBA_TAB_COLS WHERE DATA_TYPE = 'TIMESTAMP(6)'
|
|
|
|
|
http://shaharear.blogspot.com |
| Posted: May 01, 2008 05:15:40 AM | |
|
Total Post: 128
Joined: Apr, 2008
|
suppose table_1 ( col timestamp(6) )can not be modefy to timestamp(2) if the table_1 contains any row that have timestamp(6) size data
so good idea is that first add a timestamp(2) type column
coppy data to timestamp(6) -> timestamp(2)
and drop timestamp(6) column
|
|
|
|
|
Murtuja |
| Posted: May 01, 2008 05:43:32 AM | |
|
Total Post: 857
Joined: Jan, 2006
|
yes Hasan,
It's good idea.We cant convert timestamp(6) to timestamp(2) directly.
|
|
|
|
|
arun |
| Posted: May 02, 2008 02:56:16 AM | |
|
Total Post: 2
Joined: May, 2008
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |