[fdo-users] Re: Number of geometry types in Oracle FeatureClass
hanko
hana.jaborova at spatialtechnology.se
Mon Jun 14 03:25:50 EDT 2010
Thanks for help,
This code works:
public void SQLQuery()
{
// create the command
using (ISQLCommand sqlCommand =
(ISQLCommand)FDOConnection.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_SQLCommand))
{
long count = -1;
string sql = "SELECT COUNT(1) AS CONT FROM MYSCHEMA.MYTABLE t WHERE
t.GEOMETRY.sdo_gtype IN(2001, 3001, 2005, 3005)";
//sql = "select distinct a.GEOMETRY.sdo_gtype from MYSCHEMA.MYTABLE a";
sqlCommand.SQLStatement = sql;
try
{
using (ISQLDataReader dataReader = sqlCommand.ExecuteReader())
{
while (dataReader.ReadNext())
{
int nr = dataReader.GetColumnCount();
string name = dataReader.GetColumnName(0);
DataType type = dataReader.GetColumnType(0);//decimal
count = (long)dataReader.GetDouble(name);
Console.WriteLine("Count {0}", count);
}
}
}
catch (OSGeo.FDO.Common.Exception ex)
{
System.Console.WriteLine(ex.Message + " " + ex.InnerException);
}
}
}
Cheers
Hanko
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Number-of-geometry-types-in-Oracle-FeatureClass-tp5161882p5176414.html
Sent from the FDO Users mailing list archive at Nabble.com.
More information about the fdo-users
mailing list