tableList = ["DATABASE CONNECTIONS/prod.odc/sales"] fieldList = ["sales.id",'id'] whereClause = "sales.CREATED_DATE between to_date(sysdate, 'DD-MON-YYYY') AND SYSDATE" keyField = "sales.id" lyrName = "live_sales" #Create the spatial reference for the output layer. sr = arcpy.SpatialReference("WGS 1984 UTM Zone 12N") # Create a query layer arcpy.MakeQueryTable_management(tableList, lyrName,"USE_KEY_FIELDS", keyField, fieldList, whereClause) # save the created query layer arcpy.SaveToLayerFile_management(lyrName,"I:/sales.lyr", "ABSOLUTE") # Print the total rows print arcpy.GetCount_management(lyrName)
fieldList = [["sales.id",'id']]
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.