Missing column when importing an XML file
766119Sep 22 2010 — edited Sep 23 2010Hi All,
I'm having a problem while I try to import an XML file, here is the description of the problem ...
Now let’s say that I create a data model from the following XML
<DisplayStyle>
<Type>Unit</Type>
<NumberOfUnits>1</NumberOfUnits>
<DefaultOrientation>Front</DefaultOrientation>
<PreferredOrientation>Front, Bottom, Bottom90, Bottom270, Left, Left180, Left270, Top90, Top180, Top270</PreferredOrientation>
<Shape>I_Box</Shape>
</DisplayStyle>
Once the datastore is created I’ll have a table, called DISPLAYSTYLE, with the following columns:
Type
NumberOfUnits
DefaultOrientation
PreferredOrientation
Shape
And up to here is everything fine and easy …
In the XML that I would like to import, the <Shape> node will be optional, so does it mean that the <Shape> field could be present or not in the XML.
Here comes the problem…
When I try to run the interface previously created with an XML file where the <Shape> field is missing, I’ll get this error:
-28 : S0022 : java.sql.SQLException: Column not found: MSM_I_DISPLAYSTYLE.SHAPE in statement [select DISTINCT … … … ]
And also when from the interface I try to get the data just for the “Shape” Column I’ll get an error
“Cannot find data”
See com.borland.dx.dataset.DataSetException error code: BASE+66
com.borland.dx.dataset.DataSetException: Column not found: SHAPE in statement [select SHAPE, count(*) from MSM_I_DISPLAYSTYLE MSM_I_DISPLAYSTYLE group by SHAPE]
at com.borland.dx.dataset.DataSetException.a(Unknown Source)
at com.borland.dx.dataset.DataSetException.throwException(Unknown Source)
at com.borland.dx.dataset.DataSetException.SQLException(Unknown Source)
at com.borland.dx.sql.dataset.Database.createPreparedStatement(Unknown Source)
at com.borland.dx.sql.dataset.o.a(Unknown Source)
at com.borland.dx.sql.dataset.o.d(Unknown Source)
at com.borland.dx.sql.dataset.o.f(Unknown Source)
at com.borland.dx.sql.dataset.QueryProvider.e(Unknown Source)
at com.borland.dx.sql.dataset.JdbcProvider.provideData(Unknown Source)
at com.borland.dx.dataset.StorageDataSet.refresh(Unknown Source)
at com.borland.dx.sql.dataset.QueryDataSet.refresh(Unknown Source)
at com.sunopsis.graphical.frame.bn.p(bn.java)
at com.sunopsis.graphical.frame.bn.<init>(bn.java)
at com.sunopsis.graphical.q.b.g.a(g.java)
at com.sunopsis.graphical.q.b.g.b(g.java)
at com.sunopsis.graphical.q.b.bm.b(bm.java)
at com.sunopsis.graphical.t.i.y.actionPerformed(y.java)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Any have an idea on what I have to do to get just ‘NULL’ or an empty string when a particular column is not present in the XML?
Thanks a lot
Ben