Change Query Layer Definition with Arcpy

849
1
07-12-2012 07:53 AM
DanaReed
New 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
Occasional Contributor III
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