By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,905 Members | 902 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,905 IT Pros & Developers. It's quick & easy.

DB2 - XML and Spatial data in same column - can't alter table once created - PLEASE HELP

P: n/a
I'm testing out db2 for a project I'm starting that requires proper xml
support and I can't seem to get both xml and spatial data to work well
in the same table.

Once having created a table containing both xml and spatial data fields
I can't seem to find a way to alter the table
I have created a table containing an id, xmldata field and a ST_Point
If I try to drop the xml field with ALTER TABLE TEST DROP COLUMN
XMLDATA I get an error message saying
alter table etest drop column xmldata
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1242N An XML feature is not supported in the context where it is
used.
Reason code = "7". SQLSTATE=42997

(7 being:)
7 For tables containing columns of data type XML, a
REORG-recommended operation cannot be specified in an ALTER TABLE
statement.
If I try to drop the column through the alter table dialog box.. I get
an error due to the fact that I have spatial data

DBA7902 Do not attempt to alter a table containing non-supported column
data types.

I have the same problem trying to delete the spatial column...

If I use the alter talbe dialog.. I get the same error as ubove...
If I do a ALTER TABLE TEST DROP LOCATION (location being
a POINT) I get the first error message sayign that you can't do a alter
table drop... if there is xml data present in the table...
The ALTER TABLE command won't work if there is any xml data, and the
ALTER TALBE dialog box won't function if there is any spatial data.. so
in essence once I create the table, I can't change it.. although you
can properly insert data into it.
I split the table into two. and a made a view to unite the two.. but I
think this is a silly solution and there must be something I'm doing
wrong.. I don't want a separate table JUST for the location field.

I hope this is something trivial and that I just don't know db2 well
enough.

Sep 18 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You'll need to drop and recreate the table yourself.
Sorry
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.