Examine these statements:
Which is true about modifying the columns in ALTER_TEST?
Examine these statements:
Which is true about modifying the columns in ALTER_TEST?
To determine the correct answer, it is important to understand the constraints and possibilities of modifying columns in an Oracle table using the ALTER TABLE statement. Columns can typically be modified to change their data type as long as certain conditions are met. The key condition here is that reducing the length of a VARCHAR2 column is only possible if the current data fits within the new length, and similarly, increasing the precision or scale of a NUMBER column is possible, but reducing it is only possible if the current data fits within the new precision/scale. Given the provided code, it is possible to change c1 from VARCHAR2(10) to VARCHAR2(5) and c2 from NUMBER(10) to NUMBER(12,2) without violating these rules. Therefore, the correct answer is that c1 can be changed to VARCHAR2(5) and c2 can be changed to NUMBER(12,2).
E is right answer. Column must be empty to change datatype.
E is correct
E Correct. create table a_test (c1 VARCHAR2(10), c2 NUMBER(10)); insert into a_test values ('123', 123); select * from a_test; commit; alter table a_test modify c1 VARCHAR2(5); alter table a_test modify c2 NUMBER(12,2); desc a_test; if alter table a_test modify c1 VARCHAR2(2); ORA-01441: cannot decrease column length because some value is too big
alter table a_test modify c2 NUMBER(15,2); - worked BUT alter table a_test modify c2 NUMBER(15); - don't worked ORA-01440: column to be modified must be empty to decrease precision or scale
What makes A incorrect?
I think E is correct
E is correct
E tested