Home Discussion Discuss: Change Column Name of a Table

  • From java changing a column name in mysqlPhill Prescott May 23, 2012 at 3:36 AM

    I downloaded the code located on the internet page: http://www.roseindia.net/jdbc/jdbc-mysql/ChangeColumnName.shtml and have trying to use it to change the column names in several of my tables. The code worked fine for changing the index colum. When it asked the "type" of the column I put in "int" and it accepted this as correct. However when I tried the code on an mysql VARCHAR field (string field) I could not get it to work. I used everything I could think of (VARCHAR, varchar, char, string, String, literal, etc.) and it didn't like any of my entries. I kept getting the "wrong entry" message. I also rechecked the other entries carefully to make sure I was typing them in according to the spelling and capitalization I had used in the table. Can you help me with the "type" for the VARCHAR field in mysql? Thanks.

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
SQL Question

Altering a Column name in a table
Altering a Column name in a table  how to alter column name in MSSQL server 2005 the codesample given using "change" keyword alter table tablename change oldcolumnname to newcolumnname is not working 

JDBC

Change Column Name of a Table
Change Column Name of a Table   ...: This is a name of the table in which we have to change the column name.   old_col... Change column name in a database table example! Enter table name 

SQL Tutorial

SQL Alter Column Name
:  Alter table table_name change old_column_name new_column..._Table'. The change keyword change the column name of  Stu_Id to Id...; Alter Column Name in SQL is used to change or modify the name of column 

Quartz Tutorials

SQL Alter Column Name
;  Alter Column Name in SQL is used to change or modify the name... Table is given below:  Alter table table_name change old... Table alter the table 'Stu_Table'. The change keyword change the column 

SQL Question

how to Change column name and Make a unique column.
table [table name] change [old column name] [new column name] varchar (50); for make a column unique- alter table [table name] add unique ([column name...how to Change column name and Make a unique column.   how to Change 

MySQL

SQL get Column Name
SQL get Column Name       SQL get Column Name is used to return the Fieldnames of the table... get Column Name'. To understand and elaborate example we create a table 'stu 

Servlets

Changing column name
the name of the column. As this is not the work of the programmer to change...; The table in the database before changing of column name... Changing column name       

JSP-Tutorials

Shorting Table View By Column Name
Shorting Table View By Column Name This tutorial explains how to shorting table view by column name from the database in JSP and Servlet. This example... shorting  table view by column name. The code of "userdetails.jsp 

MySQL

Rename column name of table using DBCP
 

JDBC

Change Column Name in MySQL
Table name and change. The current column is named old_col but if you want... is run to change the specific column name:- table_name: This is a name of the table in which we have to change the column name. old_col: The old 

Java-Tutorials

Changing the Name of Column in a JTable
the name of column, you must have to change the column header. For changing the name.... Description of program: This program helps you to change the name of column in JTable. For changing the name, you will need a table and column index that have 

SQL Question

How to copy existing column along with data and column name into another existing table
and column name also into another existing table... For ex; TableA : Address email...How to copy existing column along with data and column name into another... way to copy both column name and data 

Database-Tutorials

Display the column name using DBCP
;Columns Name: ");         ...;    System.out.println(col_name);      

Programming Tutorials

JavaScript Hide Table Column
JavaScript Hide Table Column...; In this section, we are going to hide a table column using JavaScript. In the given example, we have created a table consisting of four columns. Here we 

JDBC

Adding a New Column Name in Database Table
Adding a New Column Name in Database Table  ... that we have created a table and forgets to add some important column name..., it takes table name, column name and it's data type and at last add a new column 

Java-Tutorials

Deleting row and column from a table
and column of a table. First we create connection to a database using... " keyword and also can delete column using "Alter" table commands....");                           // This sql query delete the column name 

JDBC

Delete a Column from a Database Table
exception. After establishing the connection gives a table name and column name...! Enter table name: Student Enter column name: Stu_marks... Delete a Column from a Database Table    

JSP-Tutorials

Make Unique Column in Database Table
that it will run,  Now give the table name and column name to which you want to make... is used to make unique of any column . It takes table name and column name. Here...! Enter table name: Student Enter column name that you want 

JDBC

Sum of Column in a Database Table
column! Enter table name: emp_sal Enter column name which... Sum of Column in a Database Table   ... of specific column data in the database table. Consider an example of any 

SQL Question

How to Delete a column and Add a new column to database
query is executed for add and delete a column in a table- for drop a column- alter table [table name] drop column [column name]; for add a column in a table- alter table [table name] add column [new column name] varchar (20); Thanks 

SQL Tutorial

Mysql Alter Column
) Query for altering the column name of the table employee1: The Query below is used to modify the table 'employee1' and change the name of column from...; Mysql Alter Column is used to modify table and  change 

SQL Tutorial

SQL Add Column
as below:   ALTER TABLE table_name ADD column_name column...; SQL Add Column is used to add a new column in the existing table. Understand... construct a table name 'Stu_Table' with Table attribute like field name and data type 

MySQL

Mysql Add Column Number
; ALTER TABLE table_name ADD column_name column...; Mysql Add Column Number is used to add the column to the existing table... Column Number'.To understand and grasp this example we create a table 'Stu 

JSP Servlet Questions

Column select
Column select   How i fetch Experience wise resume?   Create a column experience which consist of only two values either yes... import="java.sql.*"%> <table border="1"> <% try { Class.forName 

SQL Tutorial

SQL Alter Column
the table and add a column name that you want to add and its data type. ALTER TABLE table_name ADD column_name column-definition...; SQL Alter Column modifies the existing table and add a column 

JDBC

Remove Unique Column in Database Table
that it will take a table name and column name from which we want to remove the unique key... Remove unique column example! Enter table name: Student Enter... Remove Unique Column in Database Table    

JDBC

Arrange a Column of Database Table
need to give a table name and column name which have to be in ascending order... column name and table name as its input.    col_name: This is a column...! Enter table name: emp_sal Enter column name which have to see 

SQL Tutorial

MySQL Add Column
the table 'employee' and add a new column 'address' to the existing table 'employee... MySQL Add Column       MySQL Add Column tutorial explains you to add the column to the existing 

SQL Tutorial

Mysql Alter Rename Column
) Query to alter column name: The Query alter table modifies...;  Mysql Alter Rename Column is used to modify the table definition and rename the existing column of table. Understand with Example 

SQL Tutorial

SQL Alter Column Syntax
name and add a index key on column of a table. Alter Table Name  | ADD... | DROP DEFAULT} | CHANGE [COLUMN] old_col_name new_col_name column_definition...; SQL Alter Column Syntax modifies the existing table definition 

DMCA.com