Select to view content in your preferred language

Change Query Layer Definition with Arcpy

1010
1
07-12-2012 07:53 AM
DanaReed
Emerging Contributor
Hi,

I have a mxd file with some query layers (File->Add Data->Add Query Layers). Is it possible to change the query layers's definition with arcpy? I need change both the SQL statement and the database connection.

Thanks.
Tags (2)
0 Kudos
1 Reply
SolomonPulapkura
Frequent Contributor
Do you mean the Query Layer's Definition Query?
I think you can although I never tried it. You should use ListTableViews function in arcpy.mapping module

See the example here http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/ListTableViews/00s300000006000000/
0 Kudos