Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Working on an .net arcobjects app that's connecting to a Geodatabase (Oracle) through ArcSDE. I make a bunch of edits inside a EditSession but the data I am touching have a bunch of foreign Key constraints that I have to enforce by inserting/updating a bunch of records (non spatial) before I commit/flush/close my edit session.

Is there a way to execute those queries through the same session being used by ArcSDE without having to deal with Table feature classes? Something that allow me to run pure SQL through an edit session?

share|improve this question
up vote 1 down vote accepted

You can execute sql statements in the same connection, but arbitrary selections become more difficult. You can take a look at the IWorkspace::ExecuteSql method for DDL or DML. Selections have to be done through either a query layer or a QueryDef.

share|improve this answer

I don't think so. If you want to use the edit session, I think you are going to have to do it the ArcObjects way with table feature classes.

If your intent issue a SQL transaction and the editSession and combine into one transaction, you might be able to...

 start a normal Oracle transaction  
 try {
     update the foreign tables with just SQL
     start the editSession
         if (error) throw error and undo, else close editSession
     commit the Oracle transaction  
} catch { if errors in editSession, rollback}
share|improve this answer
Thanks Awesomo.. That's exactly what I am doing right now but I thought there might be a better way.. The issue is that the Oracle session and the one started by the editSession are not the same, so the edit I do to the foreign table are not visible to the editsession until I commit them. – giscope Jan 24 '13 at 17:53

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.