While creating a table, by mistake you have given size of one
field as 10. But as per requirement size should be 8. What is
your next step?

Answers were Sorted based on User's Feedback



While creating a table, by mistake you have given size of one field as 10. But as per requirement ..

Answer / hameed shaik

In Db29 we can alter the column size but cannot delete the column..
I did it so many times.. ALTER TABLE Tablename ALTER COLUMN columnname SET DATA TYPE VARCHAR(51)

Is This Answer Correct ?    7 Yes 0 No

While creating a table, by mistake you have given size of one field as 10. But as per requirement ..

Answer / mr.perfect

IF field is having empty in table , then we can reduce or
increase the size of the field, using the alter statement .
i.e . alter table <tablename>
modify <new columnname ><data type><new size>
if the data in the table is non-empyt, then we cannot alter
the table. better to delete the column and add the same
column to new size.

Is This Answer Correct ?    4 Yes 3 No

While creating a table, by mistake you have given size of one field as 10. But as per requirement ..

Answer / naidu sekhar yandrapu

once enter into column length ,we can increase the data length if a table is empty but if the table is non empty we can only
increase the(data length)

in this situation add one more column should be size is 8.

Is This Answer Correct ?    5 Yes 6 No

While creating a table, by mistake you have given size of one field as 10. But as per requirement ..

Answer / rahul

If table is empty then we alter this column to any length,
but if some data got inserted into the table then we can
also decrease the column length upto largest data size
available in that perticulat column.

Is This Answer Correct ?    1 Yes 5 No

Post New Answer

More DB2 Interview Questions

Explain various types of locks in db2?

0 Answers  


What is the purpose of the WHENEVER statement?

1 Answers  


What is copy book?

1 Answers   Thomson Reuters,


Can All Users Have The Privilege To Use The SQL Statement Select (DML)?

1 Answers  


Can a unique index have more than one null value? If not, what error code is given if an attempt is made to insert more than one null value?

3 Answers  






in the CURSOR declare statement, if i am using an where clause and trying to compare the value with a host-varialble. EXEC SQL DECLARE C1 CURSOR FOR SELECT DEPTNO, DEPTNAME, MGRNO FROM DEPARTMENT WHERE ADMRDEPT = :ADM-DEPT Where would i need to provide value to this host-variable in the where clause. how could i pass value to this host-variable to check it.

2 Answers   iGate,


Define data page.

0 Answers  


What is the use of db2?

0 Answers  


What is the meaning concurrency in the db2 database?

0 Answers  


How do you select a row using indexes in db2?

0 Answers  


how many bytes timestamp token occupies?

6 Answers   Boss Global, Cap Gemini, TCS,


What are the isolation levels possible ?

3 Answers  


Categories