Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm developping an ArcMap Extension and I need to join an existing feature class with data from a sql query located on another DBMS.

I already set up a Workspace with an OleDbWorkspaceFactory. I'm even able to add to the document any table contained in this database. I'm now trying to add a sql query to the document the same way I do it with tables. The query can be complex and include a couple of table with inner/left joins.

I looked in the ESRI documentation and I can't find the good object to do this.

Thanks

share|improve this question
1  
Have you tried the Make Query Table tool? – Kirk Kuykendall Feb 21 at 19:07
I really need to be able to put a full sql statement ("Select ... from ... inner join ... where ..."), like when I define a new query layer in ArcMap – Goldorak84 Feb 21 at 19:33
Are you saying you want to automate the process of doing File>Add Data>Add Query Layer... in arcmap? – Kirk Kuykendall Feb 21 at 19:46
2  
Did you check to see if ISqlWorkspace.OpenQuery returns a featureclass when the query includes a geometry column? – Kirk Kuykendall Feb 21 at 20:06
1  
I could always dynamically create the view (with the "CREATE VIEW" sql statement) and do an OpenTable on the view. – Goldorak84 Feb 21 at 20:39
show 4 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.