Hi All,
What does Data truncation mean ?
I will explain my requirement with example :
I have a table EMPLOYEE, it has columns NAME VARCHAR(20),AGE NUMBER(4) and SALARY VARCHAR(10).
For the first time the tables are created with the intial length and the following values are inserted into the table :
NAME : JAINY
AGE : 25
SALARY : 5000000000
Now my requirement is to set the length of SALARY column from 10 to 5 and if data present in the the column is greater than the new length do a substring and then alter the table with new length.
i.e when we dont use hibernate , I run a query UPDATE EMPLOYEE SET SALARY = SUBSTR(SALARY, 0, 5) and then i run a query ALTER TABLE SALARY MODIFY(SALARY VARCHAR(5)).
Now my question is : Does hibernate provide any option to achieve the above requirement or I have to execute the above set of queries only and if I have to execute Update and Alter table queries , how to execute alter table modify option.
What does Data Modification mean ?
Consider the EMPLOYEE table mentioned above. My requirement for Datatype modifiation is to change the datatype of SALARY cloumn from VARCHAR to NUMBER. Can this be achived by just changing the Data Type in the Employee POJO class. If not then how to achieve this ?
Hibernate version: 3.1.3
Name and version of the database you are using:Oracle9i
Thanks in advance.
All the help is much appreciated.
Regards ,
Jainy.
|