473,847 Members | 2,464 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

alter query

hi ,

i have some simple doubt in DB2
1. can we disable or enable an INDEX.
2. can we drop a column from a table .
3. can we change the datatype of a column i.e say from varchar to
integer

Please help me update my knowledge.

thanks
bikash

Mar 24 '06 #1
3 1763
bi******@in.ibm .com wrote:
hi ,

i have some simple doubt in DB2
1. can we disable or enable an INDEX.
What do you have in mind with disable/enable? Should the index not be used
during queries or not being maintained during DML statements?
2. can we drop a column from a table .
Not yet. But the Control Center provides a way to do that.
3. can we change the datatype of a column i.e say from varchar to
integer


No.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Mar 24 '06 #2
bi******@in.ibm .com wrote:
hi ,

i have some simple doubt in DB2
1. can we disable or enable an INDEX. DROP INDEX.... 2. can we drop a column from a table . In DB2 V8 for zOS yes. In DB2 for LUW this will be supported in Viper,
today (V8.2) there is GUI driven support in the control center. 3. can we change the datatype of a column i.e say from varchar to
integer

In DB2 for LUW you can INCREASE the length of a VARCHAR column.
In Viper you will be able to do any alter which cannot cause loss of data.
VARCHAR->INTEGER: No
INTEGER->VARCHAR: I think yes in Viper.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Mar 24 '06 #3
Serge Rielau wrote:
bi******@in.ibm .com wrote:
hi ,

i have some simple doubt in DB2
1. can we disable or enable an INDEX.

DROP INDEX....
2. can we drop a column from a table .

In DB2 V8 for zOS yes. In DB2 for LUW this will be supported in Viper,
today (V8.2) there is GUI driven support in the control center.
3. can we change the datatype of a column i.e say from varchar to
integer

In DB2 for LUW you can INCREASE the length of a VARCHAR column.
In Viper you will be able to do any alter which cannot cause loss of
data.
VARCHAR->INTEGER: No
INTEGER->VARCHAR: I think yes in Viper.

Cheers
Serge

Just be careful on the GUI driven option as I believe the underlying
task is to drop and recreate the table?

Bob
Mar 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
44307
by: Heist | last post by:
Hi, I just want to know to turn this: CREATE TABLE . ( NOT NULL , (50) COLLATE French_CI_AS NULL , NOT NULL , (50) COLLATE French_CI_AS NOT NULL , NULL , NULL ) ON into this:
7
5414
by: Jon Combe | last post by:
I have created the following test SQL code to illustrate a real problem I have with some SQL code. CREATE TABLE JCTable ( CustomerName varchar(50) ) ALTER TABLE JCTable ADD CustomerNo int INSERT INTO JCTable ( CustomerName , CustomerNo ) VALUES ( 'Jon Combe' , 1 ) INSERT INTO JCTable ( CustomerName , CustomerNo ) VALUES ( 'Bill Gates' , 1 ) UPDATE JCTable SET CustomerNo = 2 WHERE CustomerName = 'Jon Combe'
1
17152
by: boonkit | last post by:
I try to get better performance by implementing this: http://dev.mysql.com/doc/mysql/en/alter-table.html "ORDER BY allows you to create the new table with the rows in a specific order. Note that the table does not remain in this order after inserts and deletes. This option is mainly useful when you know that you are mostly going to query the rows in a certain order; by using this option after big changes to the table, you might be able...
7
2631
by: pb648174 | last post by:
I am trying to add a column to a temp table and then immeditaely query against that new column. If I do this in Query Analyzer it works fine as long as there is a go in between, but I can't use a go inside a stored proc.. How do i get SQL to finish processing the alter table command so I can use the new column? alter table #TempPaging add TIId int not null identity --go --fixes the problem in QA, but not in proc Select * From...
0
6244
by: Gianfranco | last post by:
Hi, I'm not familiar at access and at VBA either, so I need some help or at least some hint please. I have table "availabledrivers", coming from a query to the table "drivers". Then I have a table "availablebus" coming from a query to "bus". Bus and Drivers have autonumber ID, so the tables I get have the IDs screwed up..I mean..there are "holes" in them..it's like 1,2,5,7,11,20 etc Now..I need to link the 2 resulting table...and I have...
4
3915
by: Jeff Kish | last post by:
Hi. I have a database I need to supply something (I'm assuming a t-sql script.. maybe something else is better) to update customer tables with. The operations include mostly changing varchar lengths, though a couple of columns were renamed. I'd like to maybe figure out how to get Enterprise Manager or Query Analyzer to generate the scripts.
2
12873
by: Jeff_in_MD | last post by:
Hi, I'm trying to add a column to a table, then update that column with a query. This is all within a single batch. Sqlcmd gives me an error on the update, saying "invalid column xxx", because it doesn't know the column got added. We used to get around this in "osql" by using the EXECUTE command, like: EXEC ("ALTER TABLE tbl ADD newfield varchar(255) not null default ' '") However, it looks like sqlcmd actually checks each query...
6
7365
by: Barry | last post by:
In sqlserver 2000 I have a UDF which works fine but I want to make a change to it. When I do an ALTER FUNCTION ... I get an error saying that I can't alter the function because it is referenced by an object. Is there any way around this? I reference the UDF in over 100 tables, do I have to go to each table, remove the all references alter the function then edit each 100 tables again? How clumsy can it be? Barry
1
2054
by: prosad | last post by:
hi, have a mysql query that orders entry by complaint category. this query is then used with mysql_fetch_array to generate table of records ordered by complaint and other parameters. i can alter color for every even and odd row but how can i alter row color based on each specific 'ORDER BY' mysql query? so how can i change color for every unique order of $stat_rec. my code below:
1
6487
by: Chris | last post by:
Hi, I am trying to run the following SQL through the DB2 command line for version 9.1.0: alter table SCHEMA.TABLE1 drop column A; alter table SCHEMA.TABLE2 alter column B set data type decimal(15,4);
0
10981
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10643
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10706
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9477
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7879
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7050
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5907
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.