472,804 Members | 810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,804 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 3648
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 ) /
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.