FDO Select command not working ("column ambiguously defined")

7 messages Options
Embed this post
Permalink
Shaik Esu

FDO Select command not working ("column ambiguously defined")

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

 

 

Hi All,

 

I am trying to access the data from one table of oracle spatial using FDO.

 

The table which I am trying to access contains a column which is the “FOREIGN KEY” to another table and both column names are same.

 

When I am trying to execute the select command it is throwing error like ("column ambiguously defined"). I tried to findout the cause for this on the web it says that “when a join query contains two columns with same the name this error will raise”.  But in my code I am accessing only one table there are no joins in this….

 

I am posting my code along with this mail… please help me to solve this issue,

 

 

Thank you,

Shaik Esu.

 

 

 

 

 

 

 

 

 

 



using System;
using System.Collections.Generic;
using System.Text;
using OSGeo.FDO;
using OSGeo.FDO.Geometry;
using OSGeo.FDO.ClientServices;
using OSGeo.FDO.Connections;
using OSGeo.FDO.Commands;
using OSGeo.FDO.Commands.DataStore;
using OSGeo.FDO.Commands.Feature;
using OSGeo.FDO.Commands.Schema;
using OSGeo.FDO.Expression;
using OSGeo.FDO.Schema;
using OSGeo.FDO.Spatial;
using OSGeo.FDO.Common;
using System.Windows.Forms;

namespace WindowsApplication2
{
    class FDOOracleSpatialClass
    {
        private static IProviderRegistry FDORegistry = FeatureAccessManager.GetProviderRegistry();
        private IConnectionManager FDOManager = FeatureAccessManager.GetConnectionManager();
        ProviderCollection pcol = FDORegistry.GetProviders();
       
        private IConnection FDOConnection = FeatureAccessManager.GetConnectionManager().CreateConnection("Autodesk.Oracle.3.3");
     
        public ConnectionState Constate;
        string featureclsname;

        public FDOOracleSpatialClass(string username, string password, string servicename, string featureclassname)
        {

         
           FDOConnection.ConnectionInfo.ConnectionProperties.SetProperty("USERNAME", username);
           FDOConnection.ConnectionInfo.ConnectionProperties.SetProperty("PASSWORD", password);
           FDOConnection.ConnectionInfo.ConnectionProperties.SetProperty("SERVICE", servicename);
           FDOConnection.ConnectionInfo.ConnectionProperties.SetProperty("DATASTORE", username);
       

           featureclsname = featureclassname;


           Constate = FDOConnection.Open();
           
        }

        public ConnectionState CheckConnected
        {
            get
            {
                return Constate;
            }
        }

        public GeometryCollection SelectAllQuery(string value)
        {
            GeometryCollection Geo_Collection = new GeometryCollection();
            try
            {
               
             
                ISelect sel = (ISelect)FDOConnection.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_Select);
                sel.SetFeatureClassName(featureclsname);
               

                IFeatureReader FDOReader = sel.Execute();
                FgfGeometryFactory gFac = new FgfGeometryFactory();
                while (FDOReader.ReadNext())
                {
                   
                   // Byte[] Tmppts = FDOReader.GetGeometry("GEOM");
                    Byte[] Tmppts = FDOReader.GetGeometry("GEOMFOOTPRINT");
                    Geo_Collection.Add(gFac.CreateGeometryFromFgf(Tmppts));
                }

           
            }
            catch(OSGeo.FDO.Common.Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
               
            }
            return Geo_Collection;
        }

        public IPolygon GetExtents(string featureclassname)
        {
            IPolygon retpolygon;
            ISelectAggregates pselagree = (ISelectAggregates)FDOConnection.CreateCommand(CommandType.CommandType_SelectAggregates);
            pselagree.SetFeatureClassName(featureclassname);

            IdentifierCollection props = pselagree.PropertyNames;
            Expression exp = Expression.Parse("SpatialExtents(GEOM)");
            ComputedIdentifier se = new ComputedIdentifier("Extents", exp);

            props.Add(se);

            IDataReader FDOReader = pselagree.Execute();
            FgfGeometryFactory GeoFac = new FgfGeometryFactory();

            FDOReader.ReadNext();
            Byte[] Tmppts = FDOReader.GetGeometry("Extents");

            IGeometry Geo = GeoFac.CreateGeometryFromFgf(Tmppts);

            retpolygon = (IPolygon)Geo;

            return retpolygon;

        }

        public void UpdateQuery()
        {
            throw new System.NotImplementedException();
        }

        public void DeleteQuery()
        {
            throw new System.NotImplementedException();
        }

        public void Dispose()
        {
            Close();
            FDORegistry.Dispose();
            FDOManager.Dispose();
            FDOConnection.Dispose();
        }

        private void Close()
        {
            FDOConnection.Close();
        }
    }
}

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Haris Kurtagic

RE: FDO Select command not working ("column ambiguouslydefined")

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

From .cs file I see that you are using Autodesk.Oracle provider. Perhaps try with King.Oracle, may help to find the issue.

Enabling trace on DB and looking into sql executed could help too.

Haris

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Shaik Esu
Sent: Wednesday, March 18, 2009 8:54 AM
To: [hidden email]
Subject: [fdo-users] FDO Select command not working ("column ambiguouslydefined")

 

 

 

Hi All,

 

I am trying to access the data from one table of oracle spatial using FDO.

 

The table which I am trying to access contains a column which is the “FOREIGN KEY” to another table and both column names are same.

 

When I am trying to execute the select command it is throwing error like ("column ambiguously defined"). I tried to findout the cause for this on the web it says that “when a join query contains two columns with same the name this error will raise”.  But in my code I am accessing only one table there are no joins in this….

 

I am posting my code along with this mail… please help me to solve this issue,

 

 

Thank you,

Shaik Esu.

 

 

 

 

 

 

 

 

 

 



_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Shaik Esu

RE: FDO Select command not working ("columnambiguouslydefined")

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Hello Haris,

 

Thank you for your reply,

 

What I have observed is, if I drop constrains (on non spatial columns) and run the code it is working perfectly.  

 

My question is will the “Select.Execute()” consider the constrains also?

 

 

Regards,

Shaik Esu.

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Haris Kurtagic
Sent: Wednesday, March 18, 2009 2:04 PM
To: [hidden email]; FDO Users Mail List
Subject: RE: [fdo-users] FDO Select command not working ("columnambiguouslydefined")

 

From .cs file I see that you are using Autodesk.Oracle provider. Perhaps try with King.Oracle, may help to find the issue.

Enabling trace on DB and looking into sql executed could help too.

Haris

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Shaik Esu
Sent: Wednesday, March 18, 2009 8:54 AM
To: [hidden email]
Subject: [fdo-users] FDO Select command not working ("column ambiguouslydefined")

 

 

 

Hi All,

 

I am trying to access the data from one table of oracle spatial using FDO.

 

The table which I am trying to access contains a column which is the “FOREIGN KEY” to another table and both column names are same.

 

When I am trying to execute the select command it is throwing error like ("column ambiguously defined"). I tried to findout the cause for this on the web it says that “when a join query contains two columns with same the name this error will raise”.  But in my code I am accessing only one table there are no joins in this….

 

I am posting my code along with this mail… please help me to solve this issue,

 

 

Thank you,

Shaik Esu.

 

 

 

 

 

 

 

 

 

 



_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Haris Kurtagic

RE: FDO Select command not working("columnambiguouslydefined")

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Select.Execute is executed by provider, there is nothing in FDO layer. Autodesk.Oracle is not open source so I can’t tell much more.

Observing executed SQL statements could explain the difference.

Haris

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Shaik Esu
Sent: Wednesday, March 18, 2009 9:55 AM
To: 'FDO Users Mail List'
Subject: RE: [fdo-users] FDO Select command not working("columnambiguouslydefined")

 

Hello Haris,

 

Thank you for your reply,

 

What I have observed is, if I drop constrains (on non spatial columns) and run the code it is working perfectly.  

 

My question is will the “Select.Execute()” consider the constrains also?

 

 

Regards,

Shaik Esu.

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Haris Kurtagic
Sent: Wednesday, March 18, 2009 2:04 PM
To: [hidden email]; FDO Users Mail List
Subject: RE: [fdo-users] FDO Select command not working ("columnambiguouslydefined")

 

From .cs file I see that you are using Autodesk.Oracle provider. Perhaps try with King.Oracle, may help to find the issue.

Enabling trace on DB and looking into sql executed could help too.

Haris

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Shaik Esu
Sent: Wednesday, March 18, 2009 8:54 AM
To: [hidden email]
Subject: [fdo-users] FDO Select command not working ("column ambiguouslydefined")

 

 

 

Hi All,

 

I am trying to access the data from one table of oracle spatial using FDO.

 

The table which I am trying to access contains a column which is the “FOREIGN KEY” to another table and both column names are same.

 

When I am trying to execute the select command it is throwing error like ("column ambiguously defined"). I tried to findout the cause for this on the web it says that “when a join query contains two columns with same the name this error will raise”.  But in my code I am accessing only one table there are no joins in this….

 

I am posting my code along with this mail… please help me to solve this issue,

 

 

Thank you,

Shaik Esu.

 

 

 

 

 

 

 

 

 

 



_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Orest Halustchak

RE: FDO Select command not working ("columnambiguouslydefined")

Reply Threaded More More options
Print post
Permalink
In reply to this post by Shaik Esu
Some javascript/style in this post has been disabled (why?)

Hi Shaik,

 

What does the table look like – column names and types?

 

Thanks,

Orest.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Shaik Esu
Sent: Wednesday, March 18, 2009 4:55 AM
To: 'FDO Users Mail List'
Subject: RE: [fdo-users] FDO Select command not working ("columnambiguouslydefined")

 

Hello Haris,

 

Thank you for your reply,

 

What I have observed is, if I drop constrains (on non spatial columns) and run the code it is working perfectly.  

 

My question is will the “Select.Execute()” consider the constrains also?

 

 

Regards,

Shaik Esu.

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Haris Kurtagic
Sent: Wednesday, March 18, 2009 2:04 PM
To: [hidden email]; FDO Users Mail List
Subject: RE: [fdo-users] FDO Select command not working ("columnambiguouslydefined")

 

From .cs file I see that you are using Autodesk.Oracle provider. Perhaps try with King.Oracle, may help to find the issue.

Enabling trace on DB and looking into sql executed could help too.

Haris

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Shaik Esu
Sent: Wednesday, March 18, 2009 8:54 AM
To: [hidden email]
Subject: [fdo-users] FDO Select command not working ("column ambiguouslydefined")

 

 

 

Hi All,

 

I am trying to access the data from one table of oracle spatial using FDO.

 

The table which I am trying to access contains a column which is the “FOREIGN KEY” to another table and both column names are same.

 

When I am trying to execute the select command it is throwing error like ("column ambiguously defined"). I tried to findout the cause for this on the web it says that “when a join query contains two columns with same the name this error will raise”.  But in my code I am accessing only one table there are no joins in this….

 

I am posting my code along with this mail… please help me to solve this issue,

 

 

Thank you,

Shaik Esu.

 

 

 

 

 

 

 

 

 

 



_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Shaik Esu

RE: FDO Select command not working("columnambiguouslydefined")

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Hi Orest,

 

Thank You for reply.

 

Here are table details …

 

 

 

 

 


From: Orest Halustchak [mailto:[hidden email]]
Sent: Wednesday, March 18, 2009 5:38 PM
To: [hidden email]; FDO Users Mail List
Subject: RE: [fdo-users] FDO Select command not working("columnambiguouslydefined")

 

Hi Shaik,

 

What does the table look like – column names and types?

 

Thanks,

Orest.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Shaik Esu
Sent: Wednesday, March 18, 2009 4:55 AM
To: 'FDO Users Mail List'
Subject: RE: [fdo-users] FDO Select command not working ("columnambiguouslydefined")

 

Hello Haris,

 

Thank you for your reply,

 

What I have observed is, if I drop constrains (on non spatial columns) and run the code it is working perfectly.  

 

My question is will the “Select.Execute()” consider the constrains also?

 

 

Regards,

Shaik Esu.

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Haris Kurtagic
Sent: Wednesday, March 18, 2009 2:04 PM
To: [hidden email]; FDO Users Mail List
Subject: RE: [fdo-users] FDO Select command not working ("columnambiguouslydefined")

 

From .cs file I see that you are using Autodesk.Oracle provider. Perhaps try with King.Oracle, may help to find the issue.

Enabling trace on DB and looking into sql executed could help too.

Haris

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Shaik Esu
Sent: Wednesday, March 18, 2009 8:54 AM
To: [hidden email]
Subject: [fdo-users] FDO Select command not working ("column ambiguouslydefined")

 

 

 

Hi All,

 

I am trying to access the data from one table of oracle spatial using FDO.

 

The table which I am trying to access contains a column which is the “FOREIGN KEY” to another table and both column names are same.

 

When I am trying to execute the select command it is throwing error like ("column ambiguously defined"). I tried to findout the cause for this on the web it says that “when a join query contains two columns with same the name this error will raise”.  But in my code I am accessing only one table there are no joins in this….

 

I am posting my code along with this mail… please help me to solve this issue,

 

 

Thank you,

Shaik Esu.

 

 

 

 

 

 

 

 

 

 



_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Shaik Esu

RE: FDO Select command not working("columnambiguouslydefined")

Reply Threaded More More options
Print post
Permalink
In reply to this post by Orest Halustchak
Some javascript/style in this post has been disabled (why?)

Hi Orest,

 

Please ignore my previous mail.

 

Here are the details.

 

Reference tables

 

  create table collections(collection_id number not null,collection_name varchar(256) not null,creation_date timestamp not null,basic_type varchar(256) not null,extended_type varchar(256),current_volume varchar(256) not null,

 CONSTRAINT col_idxpk_collections PRIMARY KEY (collection_id));

 

 

 create table archives(archive_id number not null,collection_id number,

 collection_name varchar(256),

 archive_name varchar(256),

 date_ingested timestamp not null,

 created_by varchar(256) not null,

 product_type varchar(256),

  archive_size varchar(256),

   thumbnail varchar(256),

   subdir varchar(256),

 file_volume number not null,

  CONSTRAINT arc_idxpk_archives PRIMARY KEY (archive_id),

  CONSTRAINT arc_fk_collections FOREIGN KEY (collection_id)

       REFERENCES collections (collection_id),

CONSTRAINT arc_fk_fvol FOREIGN KEY (file_volume)

     REFERENCES filevolumes (volume_id));

 

 

 

Geometry table.

 

create table footprint

(collection_id number,

archive_id number,

geomfootprint mdsys.sdo_geometry,

CONSTRAINT nongeomd_collection_idxfk FOREIGN KEY (collection_id)

      REFERENCES collections (collection_id),

CONSTRAINT nongeomd_archive_idxfk FOREIGN KEY (archive_id)

      REFERENCES archives (archive_id));

 

 

Please try to help me ….

 

Thank You,

Shaik Esu.

 

 

 


From: Shaik Esu [mailto:[hidden email]]
Sent: Thursday, March 19, 2009 6:36 AM
To: 'Orest Halustchak'; 'FDO Users Mail List'
Subject: RE: [fdo-users] FDO Select command not working("columnambiguouslydefined")

 

Hi Orest,

 

Thank You for reply.

 

Here are table details …

 

 

 

 

 


From: Orest Halustchak [mailto:[hidden email]]
Sent: Wednesday, March 18, 2009 5:38 PM
To: [hidden email]; FDO Users Mail List
Subject: RE: [fdo-users] FDO Select command not working("columnambiguouslydefined")

 

Hi Shaik,

 

What does the table look like – column names and types?

 

Thanks,

Orest.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Shaik Esu
Sent: Wednesday, March 18, 2009 4:55 AM
To: 'FDO Users Mail List'
Subject: RE: [fdo-users] FDO Select command not working ("columnambiguouslydefined")

 

Hello Haris,

 

Thank you for your reply,

 

What I have observed is, if I drop constrains (on non spatial columns) and run the code it is working perfectly.  

 

My question is will the “Select.Execute()” consider the constrains also?

 

 

Regards,

Shaik Esu.

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Haris Kurtagic
Sent: Wednesday, March 18, 2009 2:04 PM
To: [hidden email]; FDO Users Mail List
Subject: RE: [fdo-users] FDO Select command not working ("columnambiguouslydefined")

 

From .cs file I see that you are using Autodesk.Oracle provider. Perhaps try with King.Oracle, may help to find the issue.

Enabling trace on DB and looking into sql executed could help too.

Haris

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Shaik Esu
Sent: Wednesday, March 18, 2009 8:54 AM
To: [hidden email]
Subject: [fdo-users] FDO Select command not working ("column ambiguouslydefined")

 

 

 

Hi All,

 

I am trying to access the data from one table of oracle spatial using FDO.

 

The table which I am trying to access contains a column which is the “FOREIGN KEY” to another table and both column names are same.

 

When I am trying to execute the select command it is throwing error like ("column ambiguously defined"). I tried to findout the cause for this on the web it says that “when a join query contains two columns with same the name this error will raise”.  But in my code I am accessing only one table there are no joins in this….

 

I am posting my code along with this mail… please help me to solve this issue,

 

 

Thank you,

Shaik Esu.

 

 

 

 

 

 

 

 

 

 



_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users