to change the title

Database

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.
6 REPLIES
Junior Supporter

Re: to change the title

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
Enthusiast

Re: to change the title

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;

Re: to change the title

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.

Re: to change the title

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.
Enthusiast

Re: to change the title

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.
Junior Supporter

Re: to change the title

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.