473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can anybody give me the exact syntax to rename a column in DB2??

Can anybody give me the exact syntax to rename a column in DB2??
Jun 15 '07 #1
5 5507
r035198x
13,262 8TB
Can anybody give me the exact syntax to rename a column in DB2??


Have you tried

alter table tableName rename column prevName to newName;
Jun 15 '07 #2
Hevan
17
Hi,

You have to drop and recreate the table . you cannot rename the column in db2.
Jun 15 '07 #3
r035198x
13,262 8TB
Hi,

You have to drop and recreate the table . you cannot rename the column in db2.
So you have to store your data in some temporary table first?
Jun 15 '07 #4
Hevan
17
Yes, Export and recreate the table with column change and import the data.
Jun 19 '07 #5
r035198x
13,262 8TB
Yes, Export and recreate the table with column change and import the data.
OK. I got it mixed up with MySQL there.
MySQL also creates a temporary table with the new changes and imports the data but all that is hidden from the programmer through the alter table command.
Jun 20 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Paul Casner | last post by:
I have a data warehouse that is about 10 terabyte's worth of data that must be loaded once a month. I am trying to use the DB2 version 8 rename table command but I discovered when you execute this...
2
by: James A | last post by:
I have 3 problems which I'd like people to solve for me (I've run out of ideas) 1) I have a table called s7-300. If i simply run this line of code: lstResult.rowsource = "Select * FROM...
0
by: Eric | last post by:
I need to rename a column in an Access Table. SQL RENAME doesn't seem to work. I found a message board from google that suggested RENAME doesn't work with Access at all. Any suggestions on how to...
2
by: Jon Lapham | last post by:
I have a table that stores TEXT information. I need query this table to find *exact* matches to the TEXT... no regular expressions, no LIKE queries, etc. The TEXT could be from 1 to 10000+...
0
by: juliane26 | last post by:
Even so it should not be there, it sometimes is: somebody wants to rename a column. Today we do unload / recreate table / load using our own db utilities to do so. Now we evaluate Object...
2
by: Tom Baxter | last post by:
I have a numeric column in a query called Prov1.Volume. When I try taking the sum of that column (using SUM aggregate function in Design View) it gives a syntax error. It says that...
6
by: sushjames | last post by:
hello experts, i'm having a problem in this synatx alter table <table name> drop column <column name> alter tabel <table name> rename column <old column name> to <new...
2
by: mike_dba | last post by:
I am running V9 FP2 on DPF. I understand that V9 LUW now lets you rename a column. I can't seem to get the sytax right. Can anyone point me to what is wrong? db2 "ALTER TABLE myschema.mytable...
1
by: Gladiator | last post by:
Hi Team , Can some one tell me why we dont we have a DROP column or rename a column command in DB2 ? I Have a very Huge table and need to rename a column . The only option i have to do to rename...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.