473,320 Members | 1,848 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,320 software developers and data experts.

Altering the type of a VARCHAR column to be VARCHAR FOR BIT DATA

Hi,

I'd like to know whether there is a way to alter the data type of a
VARCHAR FOR BIT DATA column to be simply a VARCHAR column? I executed
an ALTER TABLE statement, similar to,

ALTER TABLE tab_name ALTER COLUMN col_name SET DATA TYPE VARCHAR(100)

without any problems. However, a simple Java application reports via
JDBC that the column type is still VARCHAR FOR BIT DATA.

Secondly, how would I perform the opposite operation i.e. alter the
data type of a VARCHAR column to be VARCHAR FOR BIT DATA? A statement
such as the following fails:

ALTER TABLE tab_name ALTER COLUMN col_name SET DATA TYPE VARCHAR(100)
FOR BIT DATA

Please note that I'm looking for a solution that will be compatible
with DB2 v8 and v9.

Regards,

Ryan

May 28 '07 #1
1 3710
RGow wrote:
Hi,

I'd like to know whether there is a way to alter the data type of a
VARCHAR FOR BIT DATA column to be simply a VARCHAR column? I executed
an ALTER TABLE statement, similar to,

ALTER TABLE tab_name ALTER COLUMN col_name SET DATA TYPE VARCHAR(100)

without any problems. However, a simple Java application reports via
JDBC that the column type is still VARCHAR FOR BIT DATA.

Secondly, how would I perform the opposite operation i.e. alter the
data type of a VARCHAR column to be VARCHAR FOR BIT DATA? A statement
such as the following fails:

ALTER TABLE tab_name ALTER COLUMN col_name SET DATA TYPE VARCHAR(100)
FOR BIT DATA

Please note that I'm looking for a solution that will be compatible
with DB2 v8 and v9.
If you want a DB2 V8.2 solution then I don't think there is a way around
unload an reload of the data. You can use the ALTOBJ() procedure or the
ALTER TABLE wizard in the control center to instrument the process.

Have you considered a view? A simple CAST(c1 AS VARCHAR(100) FOR SBCS
DATA) is all you need.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
May 28 '07 #2

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

Similar topics

0
by: Dave Serrano | last post by:
I have a question about altering tables and growth of the database and transaction log. I have a database which is approximately 35GB. I had to make a change to a column in the largest table...
10
by: Jane | last post by:
Does any one know why this statement is failing? db2 => ALTER TABLE ELMT_T ALTER COLUMN CDTY_CD SET DATA TYPE VARCHAR(51) DB21034E The command was processed as an SQL statement because it was...
12
by: Prabu Subroto | last post by:
Dear my friends... I am using postgres 7.4 and SuSE 9.1. I want to use auto_increment as on MySQL. I look up the documentation on www.postgres.com and I found "serial" . But I don't know...
5
by: rAinDeEr | last post by:
Hi, I have a web application with a table to store terms and conditions of a Company. This may some times run into many pages and some times it may be just a few sentences. It is a character...
9
by: JimmyKoolPantz | last post by:
IDE: Visual Studio 2005 Language: VB.NET Fox Pro Driver Version: 9.0.0.3504 Problem: I currently have a problem altering a DBF file. I do not get any syntax errors when running the program. ...
3
by: t2581 | last post by:
Hi , I have database db2 udb 7.2 with following table and datatype CREATE DISTINCT TYPE APP.NOTEPAD AS SYSIBM .CLOB(4096); CREATE TABLE APP.AP_NOTE_PAD ( CONTROL_LOCATION INTEGER NOT NULL...
9
by: weirdwoolly | last post by:
Hopefully someone will be able to help. I have written a stored procedure in C++ called from a Java test harness to validate the graphic data types in C++ and their use. I have declared the...
5
by: WombatDeath | last post by:
Hi, I want my application to audit any data changes (update, insert, delete) made by the users. Rather than have an audit table mirroring each user table, I'd prefer to have a generic structure...
2
by: Rahul B | last post by:
Hi. I have created a table CREATE TABLE testschema.player ( country VARCHAR(80) NOT NULL, posn VARCHAR(2) not null ) /
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.