<div>Hi!</div><div><br></div>Do you run 
<span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">IApplySchema</span> command before every insert?<div>I yes,why?</div><div>All FDO providers read Schema when opening connection. </div>
<div><br></div><div>Simon</div><div><div><br><div class="gmail_quote">On Thu, Dec 1, 2011 at 4:10 PM, mdelsinne <span dir="ltr">&lt;<a href="mailto:mdelsinne@gmail.com">mdelsinne@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Mon code:<br>
<br>
// Connexion<br>
IConnectionManager connManager =<br>
FeatureAccessManager.GetConnectionManager();<br>
IConnection conn = connManager.CreateConnection(&quot;OSGeo.KingOracle.3.6&quot;);<br>
IConnectionPropertyDictionary connProperties =<br>
conn.ConnectionInfo.ConnectionProperties;<br>
OSGeo.FDO.Connections.ConnectionState connState = conn.ConnectionState;<br>
connProperties.SetProperty(&quot;Username&quot;, &quot;FDO&quot;);<br>
connProperties.SetProperty(&quot;Password&quot;, &quot;FDO&quot;);<br>
connProperties.SetProperty(&quot;Service&quot;, &quot;BASETEST&quot;);<br>
connProperties.SetProperty(&quot;OracleSchema&quot;, &quot;FDO&quot;);<br>
connProperties.SetProperty(&quot;KingFdoClass&quot;, &quot;MYFDOCLASS&quot;);<br>
connState = conn.Open();<br>
<br>
// Schema &amp; Class<br>
FeatureSchema aFeatureSchema = new FeatureSchema(&quot;KingOra&quot;, &quot;&quot;);<br>
FeatureClass aFeatureClass = new FeatureClass(&quot;CLASSTEST&quot;, &quot;&quot;);<br>
<br>
string proj = &quot;&quot;;<br>
<div class="im"><br>
// Add a key property<br>
</div>DataPropertyDefinition keyProp = new DataPropertyDefinition(&quot;KEY&quot;, &quot;&quot;);<br>
<div class="im">keyProp.DataType = DataType.DataType_String;<br>
keyProp.Length = 255;<br>
aFeatureClass.Properties.Add(keyProp);<br>
<br>
</div><div class="im">// Add a name property<br>
DataPropertyDefinition nameProp = new DataPropertyDefinition(&quot;NAME&quot;, &quot;&quot;);<br>
nameProp.DataType = DataType.DataType_String;<br>
nameProp.Length = 255;<br>
aFeatureClass.Properties.Add(nameProp);<br>
<br>
</div><div class="im">// Add a url property<br>
DataPropertyDefinition urlProp = new DataPropertyDefinition(&quot;URL&quot;, &quot;&quot;);<br>
urlProp.DataType = DataType.DataType_String;<br>
urlProp.Length = 255;<br>
aFeatureClass.Properties.Add(urlProp);<br>
<br>
</div><div class="im">// Add a geometry property<br>
GeometricPropertyDefinition geomProp = new<br>
GeometricPropertyDefinition(&quot;GEOM&quot;, &quot;&quot;);<br>
geomProp.GeometryTypes = (int)GeometryType.GeometryType_MultiGeometry;<br>
aFeatureClass.Properties.Add(geomProp);<br>
aFeatureClass.GeometryProperty = geomProp;<br>
<br>
</div>// implement the changes<br>
aFeatureSchema.Classes.Add(aFeatureClass);<br>
IApplySchema applySchema =<br>
(IApplySchema)conn.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_ApplySchema);<br>
applySchema.FeatureSchema = aFeatureSchema;<br>
applySchema.Execute();<br>
applySchema.Dispose();<br>
<br>
// Preparer insertion des données<br>
IInsert cmdInsert =<br>
(IInsert)conn.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_Insert);<br>
cmdInsert.SetFeatureClassName(&quot;FDO~CLASSTEST~GEOM&quot;);<br>
<div class="im"><br>
FgfGeometryFactory factory = new FgfGeometryFactory();<br>
</div>IDirectPosition position = factory.CreatePositionXYZ(2, 2, 0);<br>
IPoint point = factory.CreatePoint(position);<br>
cmdInsert.PropertyValues.Add(new PropertyValue(&quot;KEY&quot;, new<br>
StringValue(&quot;strKey&quot;)));<br>
cmdInsert.PropertyValues.Add(new PropertyValue(&quot;NAME&quot;, new<br>
StringValue(&quot;strName&quot;)));<br>
cmdInsert.PropertyValues.Add(new PropertyValue(&quot;URL&quot;, new<br>
StringValue(&quot;strUrl)));<br>
cmdInsert.PropertyValues.Add(new PropertyValue(&quot;GEOM&quot;, new<br>
GeometryValue(factory.GetFgf(point))));<br>
<br>
// Insert<br>
IReader reader = cmdInsert.Execute();<br>
if (reader.ReadNext())<br>
{<br>
<br>
}<br>
reader.Close();<br>
<br>
Result in Oracle:<br>
<br>
<a href="http://osgeo-org.1803224.n2.nabble.com/file/n7050862/ora1.jpg" target="_blank">http://osgeo-org.1803224.n2.nabble.com/file/n7050862/ora1.jpg</a><br>
<br>
<a href="http://osgeo-org.1803224.n2.nabble.com/file/n7050862/ora2.jpg" target="_blank">http://osgeo-org.1803224.n2.nabble.com/file/n7050862/ora2.jpg</a><br>
<br>
Thank&#39;s<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/insert-error-control-properties-with-KingOracle-tp7046704p7050862.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/insert-error-control-properties-with-KingOracle-tp7046704p7050862.html</a><br>

</font></span><div class="HOEnZb"><div class="h5">Sent from the FDO Internals mailing list archive at Nabble.com.<br>
_______________________________________________<br>
fdo-internals mailing list<br>
<a href="mailto:fdo-internals@lists.osgeo.org">fdo-internals@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/fdo-internals" target="_blank">http://lists.osgeo.org/mailman/listinfo/fdo-internals</a><br>
</div></div></blockquote></div><br></div></div>