All Forums Database
venkytd 4 posts Joined 08/10
18 Aug 2010
to change the title

Hi All,
how we can alter the table . bec i want to change the title of the field. the query is like this.

now i have the title for the column job_code title 'depart_number';
need to chage this title into 'job code'. table name is employee and the data type is integer.
can anyone help me to change the title of the field. i have already data in the table.

CarlosAL 512 posts Joined 04/08
19 Aug 2010

You can change the title (and I do mean 'TITLE'):

alter table your_db.your_table ADD job_code TITLE 'depart number';

You can change the name of the column:

alter table your_db.your_table RENAME job_code TO depart_number;

HTH.

Cheers.

Carlos.

WAQ 158 posts Joined 02/10
19 Aug 2010

Is this an index field? If not then you can use RENAME sql to get the desire result, as

ALTER TABLE tableName
RENAME oldColumnName TO newColumnName;

venkytd 4 posts Joined 08/10
19 Aug 2010

CarlosAL, you are trying to say that to add a new column but i dont want to add new column. i need to modify the existing column title not the column name..will u please provide some info on this.

venkytd 4 posts Joined 08/10
19 Aug 2010

Hi WAQ, it is not an index column but as per ur query it mean to chanage the column name but i wan to change only the title of the column..so please provide me the required info if you have..its really appreciate....for ur assistance.

umakathir 32 posts Joined 09/06
19 Aug 2010

hey, Did you try ADD option as Carlos said? Try that out it would work.

If the named column already exists, ADD indicates that its attributes are to be changed.

CarlosAL 512 posts Joined 04/08
19 Aug 2010

venkytd:

>>"CarlosAL, you are trying to say that to add a new column "

No. I don't.

RTFM:

" ADD column_name
data_type_declaration
data_type_attributes
column_storage_attributes
column_constraint_attributes

to add or change the specified column and its specified attributes."

Cheers.

Carlos.

You must sign in to leave a comment.