Select to view content in your preferred language

Updating multiversioned view fails

5250
2
Jump to solution
06-25-2015 11:47 AM
PaulKroseman
Frequent Contributor

I am attempting to edit a multiversioned view using SQL. I set the feature class to versioned, created the view from command line using "sdetable -o create_mv_view", and try to run an update with SQL on a single attribute field but receive the error:

Msg 50000, Level 16, State 1, Procedure v446_update, Line 27

User must call edit_version before editing the view.

If I try to call edit_version I get:

Msg 50000, Level 16, State 1, Procedure edit_version, Line 78

Cannot edit the DEFAULT version in STANDARD transaction mode.

I am running ArcGIS and ArcSDE 10.0 SP3 on SQL Server 2008. The ability to edit the Default version through multiversioned views is available at version 10 SP2 according to http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_editing_versioned_data....

http://support.esri.com/en/knowledgebase/techarticles/detail/39112 describes this behavior also. Not specifying an edit version still gives me the first error above.

Just to be sure, I removed all other versions, compressed to state 0, unversioned the feature class, reverionsed, and recreated the view, but still have the same problem.

Does anyone successfully use views in this way and what version is the server running? Is the documentation wrong?

0 Kudos
1 Solution

Accepted Solutions
MelissaJarman
Esri Contributor

Paul -

What you are thinking seems correct that since you are at 10.0 sp2 or higher that this should work without setting the version first - you also shouldn't have to call edit_version. Have you tried to just execute the sql directly without calling edit_version or setting the version? Take a look at this KB

39112 - Cannot edit the DEFAULT version in STANDARD transaction mode

What type of geometry is the feature class?

Editing the DEFAULT version

You could edit the DEFAULT version with SQL through versioned views if one or more of the following are true at your site:

  • The edits to be made are short transactions.
  • Your site requires that the edits made through a versioned view be available to other users immediately.
  • If editing feature classes, the feature classes use SQL spatial types, not binary geometry storage.
  • The table or feature class to be edited is not registered as versioned with the option to move edits to base.

View solution in original post

0 Kudos
2 Replies
MelissaJarman
Esri Contributor

Paul -

What you are thinking seems correct that since you are at 10.0 sp2 or higher that this should work without setting the version first - you also shouldn't have to call edit_version. Have you tried to just execute the sql directly without calling edit_version or setting the version? Take a look at this KB

39112 - Cannot edit the DEFAULT version in STANDARD transaction mode

What type of geometry is the feature class?

Editing the DEFAULT version

You could edit the DEFAULT version with SQL through versioned views if one or more of the following are true at your site:

  • The edits to be made are short transactions.
  • Your site requires that the edits made through a versioned view be available to other users immediately.
  • If editing feature classes, the feature classes use SQL spatial types, not binary geometry storage.
  • The table or feature class to be edited is not registered as versioned with the option to move edits to base.
0 Kudos
PaulKroseman
Frequent Contributor

I am trying to update a non-spatial field and have not specified a version. My SQL is simple.

UPDATE mv_view
SET datafield = 1

I think the feature class is using SDE Binary. I did not think it would make a difference when trying to update non-spatial fields.

0 Kudos