472,110 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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

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
1 3316
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.

Similar topics

2 posts views Thread by Belinda | last post: by
6 posts views Thread by David Gartrell | last post: by
2 posts views Thread by EricaLRivera | last post: by
4 posts views Thread by Scott | last post: by
2 posts views Thread by peter.prib | last post: by
reply views Thread by leo001 | last post: by

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.