IWorkspace.ExecuteSQL UPDATE with file geodatabase

1092
3
Jump to solution
10-01-2012 10:53 AM
PatriceLabbé
Occasional Contributor
Hi,

Is it possible to use an UPDATE statement like the following one with file geodatabases (v9.3) :

UPDATE table_name SET field_name = another_field_name

This kind of code always throws an exception.

Thank you!
0 Kudos
1 Solution

Accepted Solutions
LanceShipman
Esri Regular Contributor
Support has been extended at 10.1, but not at 9.3.

View solution in original post

0 Kudos
3 Replies
LanceShipman
Esri Regular Contributor
UPDATE should work. It's certainly working at 10.1. What does your update statement look like?
0 Kudos
PatriceLabbé
Occasional Contributor
This works (set an arbitrary value):

string sql = "UPDATE hydro_so_100k SET HYD_NOM = 'nom', HYD_DESCR = 'description' WHERE FEU_NO like '%12%'"

These doesn't (update field value from another one's value):

string sql = "UPDATE hydro_so_100k SET HYD_NOM = HYD_NOM , HYD_DESCR = 'description' WHERE FEU_NO like '%12%'";

or

string sql = "UPDATE hydro_so_100k SET HYD_NOM = \"HYD_NOM\" , HYD_DESCR = \"HYD_DESCR\" WHERE FEU_NO like '%12%'";

I came across this link in my searches : http://forums.esri.com/Thread.asp?c=93&f=993&t=235859

At this point, file geodatabase does not support expressions in the SET clauses of an Update statement, we only support literal values. This is not a bug. We implemented what we needed, with the plan of expanding things over time.

It seems to confirm there were limitations with UPDATE statements. Is is still true with 9.3 version?
0 Kudos
LanceShipman
Esri Regular Contributor
Support has been extended at 10.1, but not at 9.3.
0 Kudos