Skip to main content
edited body; edited tags; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

How to fix this Heatmap script gives ERROR 000358 from failing SQL expression (integer/string?) using arcpy (ArcMap 10.5)?ArcPy with ArcMap

I have a heatmap script that will eventually print 10 PDF maps. At the moment it is failing at the SQL expression in the Make Feature Layer right before Kernel Density Raster creation because the column datatype is string. I'm having trouble changing it to an integer in the loop.

Traceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 58, in int(stringA) ValueError: invalid literal for int() with base 10: '%d'

Here is the part of the script that is failing:

arcpy.CheckOutExtension('Spatial')
#use 'CURRENT' if running from arcmap, when published use MXD on disk
mxd = arcpy.mapping.MapDocument(workspace+"\\working_environment.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0] # address location data frame and turn on select layers
df.zoomToSelectedFeatures()



arcpy.env.extent = df.extent #set extent to current one
arcpy.env.overwriteOutput = True #overwrite existing files

my_point_features = autoLayerGDB +"\\coded_xy_points_FIPS4203"
scratch_output = workspace+"scratch"
    

#Select each district via script
    
   for i in range(1, 11):
    stringA = '%d'
    int(stringA)
    my_clause = 'COUNCILDISTRICT =' + stringA % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)
    

I also tried this:

for i in range(1, 11):
    my_clause = 'COUNCILDISTRICT = "%d"' % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)

But recievedreceived this error message:

raceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 59, in arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,) File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 6997, in MakeFeatureLayer raise e arcgisscripting.ExecuteError: ERROR 000358: Invalid expression COUNCILDISTRICT = "1" Failed to execute (MakeFeatureLayer).

I found gis.stackexchange.com/questions/137517/… and docs.microsoft.com/en-us/sql/odbc/microsoft/…. Based on this information I changed the schema file to interpret the COUNCILDISTRICT Collumn as "short" instead of "text" and it worked

How to fix this Heatmap script from failing SQL expression (integer/string?) using arcpy (ArcMap 10.5)?

I have a heatmap script that will eventually print 10 PDF maps. At the moment it is failing at the SQL expression in the Make Feature Layer right before Kernel Density Raster creation because the column datatype is string. I'm having trouble changing it to an integer in the loop.

Traceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 58, in int(stringA) ValueError: invalid literal for int() with base 10: '%d'

Here is the part of the script that is failing:

arcpy.CheckOutExtension('Spatial')
#use 'CURRENT' if running from arcmap, when published use MXD on disk
mxd = arcpy.mapping.MapDocument(workspace+"\\working_environment.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0] # address location data frame and turn on select layers
df.zoomToSelectedFeatures()



arcpy.env.extent = df.extent #set extent to current one
arcpy.env.overwriteOutput = True #overwrite existing files

my_point_features = autoLayerGDB +"\\coded_xy_points_FIPS4203"
scratch_output = workspace+"scratch"
    

#Select each district via script
    
   for i in range(1, 11):
    stringA = '%d'
    int(stringA)
    my_clause = 'COUNCILDISTRICT =' + stringA % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)
    

I also tried this:

for i in range(1, 11):
    my_clause = 'COUNCILDISTRICT = "%d"' % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)

But recieved this error message:

raceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 59, in arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,) File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 6997, in MakeFeatureLayer raise e arcgisscripting.ExecuteError: ERROR 000358: Invalid expression COUNCILDISTRICT = "1" Failed to execute (MakeFeatureLayer).

I found gis.stackexchange.com/questions/137517/… and docs.microsoft.com/en-us/sql/odbc/microsoft/…. Based on this information I changed the schema file to interpret the COUNCILDISTRICT Collumn as "short" instead of "text" and it worked

Heatmap script gives ERROR 000358 from SQL expression using ArcPy with ArcMap

I have a heatmap script that will eventually print 10 PDF maps. At the moment it is failing at the SQL expression in the Make Feature Layer right before Kernel Density Raster creation because the column datatype is string. I'm having trouble changing it to an integer in the loop.

Traceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 58, in int(stringA) ValueError: invalid literal for int() with base 10: '%d'

Here is the part of the script that is failing:

arcpy.CheckOutExtension('Spatial')
#use 'CURRENT' if running from arcmap, when published use MXD on disk
mxd = arcpy.mapping.MapDocument(workspace+"\\working_environment.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0] # address location data frame and turn on select layers
df.zoomToSelectedFeatures()



arcpy.env.extent = df.extent #set extent to current one
arcpy.env.overwriteOutput = True #overwrite existing files

my_point_features = autoLayerGDB +"\\coded_xy_points_FIPS4203"
scratch_output = workspace+"scratch"
    

#Select each district via script
    
   for i in range(1, 11):
    stringA = '%d'
    int(stringA)
    my_clause = 'COUNCILDISTRICT =' + stringA % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)
    

I also tried this:

for i in range(1, 11):
    my_clause = 'COUNCILDISTRICT = "%d"' % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)

But received this error message:

raceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 59, in arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,) File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 6997, in MakeFeatureLayer raise e arcgisscripting.ExecuteError: ERROR 000358: Invalid expression COUNCILDISTRICT = "1" Failed to execute (MakeFeatureLayer).

I found gis.stackexchange.com/questions/137517/… and docs.microsoft.com/en-us/sql/odbc/microsoft/…. Based on this information I changed the schema file to interpret the COUNCILDISTRICT Collumn as "short" instead of "text" and it worked

Updating body to reflect new information
Source Link

I have a heatmap script that will eventually print 10 PDF maps. At the moment it is failing at the SQL expression in the Make Feature Layer right before Kernel Density Raster creation because the column datatype is string. I'm having trouble changing it to an integer in the loop.

Traceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 58, in int(stringA) ValueError: invalid literal for int() with base 10: '%d'

Here is the part of the script that is failing:

arcpy.CheckOutExtension('Spatial')
#use 'CURRENT' if running from arcmap, when published use MXD on disk
mxd = arcpy.mapping.MapDocument(workspace+"\\working_environment.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0] # address location data frame and turn on select layers
df.zoomToSelectedFeatures()



arcpy.env.extent = df.extent #set extent to current one
arcpy.env.overwriteOutput = True #overwrite existing files

my_point_features = autoLayerGDB +"\\coded_xy_points_FIPS4203"
scratch_output = workspace+"scratch"
    

#Select each district via script
    
   for i in range(1, 11):
    stringA = '%d'
    int(stringA)
    my_clause = 'COUNCILDISTRICT =' + stringA % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)
    

I also tried this:

for i in range(1, 11):
    my_clause = 'COUNCILDISTRICT = "%d"' % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)

But recieved this error message:

raceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 59, in arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,) File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 6997, in MakeFeatureLayer raise e arcgisscripting.ExecuteError: ERROR 000358: Invalid expression COUNCILDISTRICT = "1" Failed to execute (MakeFeatureLayer).

Shouldn't COUNCILDISTRICT = "1" work?I found gis.stackexchange.com/questions/137517/… and docs.microsoft.com/en-us/sql/odbc/microsoft/…. Based on this information I changed the schema file to interpret the COUNCILDISTRICT Collumn as "short" instead of "text" and it worked

I have a heatmap script that will eventually print 10 PDF maps. At the moment it is failing at the SQL expression in the Make Feature Layer right before Kernel Density Raster creation because the column datatype is string. I'm having trouble changing it to an integer in the loop.

Traceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 58, in int(stringA) ValueError: invalid literal for int() with base 10: '%d'

Here is the part of the script that is failing:

arcpy.CheckOutExtension('Spatial')
#use 'CURRENT' if running from arcmap, when published use MXD on disk
mxd = arcpy.mapping.MapDocument(workspace+"\\working_environment.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0] # address location data frame and turn on select layers
df.zoomToSelectedFeatures()



arcpy.env.extent = df.extent #set extent to current one
arcpy.env.overwriteOutput = True #overwrite existing files

my_point_features = autoLayerGDB +"\\coded_xy_points_FIPS4203"
scratch_output = workspace+"scratch"
    

#Select each district via script
    
   for i in range(1, 11):
    stringA = '%d'
    int(stringA)
    my_clause = 'COUNCILDISTRICT =' + stringA % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)
    

I also tried this:

for i in range(1, 11):
    my_clause = 'COUNCILDISTRICT = "%d"' % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)

But recieved this error message:

raceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 59, in arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,) File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 6997, in MakeFeatureLayer raise e arcgisscripting.ExecuteError: ERROR 000358: Invalid expression COUNCILDISTRICT = "1" Failed to execute (MakeFeatureLayer).

Shouldn't COUNCILDISTRICT = "1" work?

I have a heatmap script that will eventually print 10 PDF maps. At the moment it is failing at the SQL expression in the Make Feature Layer right before Kernel Density Raster creation because the column datatype is string. I'm having trouble changing it to an integer in the loop.

Traceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 58, in int(stringA) ValueError: invalid literal for int() with base 10: '%d'

Here is the part of the script that is failing:

arcpy.CheckOutExtension('Spatial')
#use 'CURRENT' if running from arcmap, when published use MXD on disk
mxd = arcpy.mapping.MapDocument(workspace+"\\working_environment.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0] # address location data frame and turn on select layers
df.zoomToSelectedFeatures()



arcpy.env.extent = df.extent #set extent to current one
arcpy.env.overwriteOutput = True #overwrite existing files

my_point_features = autoLayerGDB +"\\coded_xy_points_FIPS4203"
scratch_output = workspace+"scratch"
    

#Select each district via script
    
   for i in range(1, 11):
    stringA = '%d'
    int(stringA)
    my_clause = 'COUNCILDISTRICT =' + stringA % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)
    

I also tried this:

for i in range(1, 11):
    my_clause = 'COUNCILDISTRICT = "%d"' % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)

But recieved this error message:

raceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 59, in arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,) File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 6997, in MakeFeatureLayer raise e arcgisscripting.ExecuteError: ERROR 000358: Invalid expression COUNCILDISTRICT = "1" Failed to execute (MakeFeatureLayer).

I found gis.stackexchange.com/questions/137517/… and docs.microsoft.com/en-us/sql/odbc/microsoft/…. Based on this information I changed the schema file to interpret the COUNCILDISTRICT Collumn as "short" instead of "text" and it worked

added another attempt that failed and the accompanying error
Source Link

I have a heatmap script that will eventually print 10 PDF maps. At the moment it is failing at the SQL expression in the Make Feature Layer right before Kernel Density Raster creation because the column datatype is string. I'm having trouble changing it to an integer in the loop.

Traceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 58, in int(stringA) ValueError: invalid literal for int() with base 10: '%d'

Here is the part of the script that is failing:

arcpy.CheckOutExtension('Spatial')
#use 'CURRENT' if running from arcmap, when published use MXD on disk
mxd = arcpy.mapping.MapDocument(workspace+"\\working_environment.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0] # address location data frame and turn on select layers
df.zoomToSelectedFeatures()



arcpy.env.extent = df.extent #set extent to current one
arcpy.env.overwriteOutput = True #overwrite existing files

my_point_features = autoLayerGDB +"\\coded_xy_points_FIPS4203"
scratch_output = workspace+"scratch"
    

#Select each district via script
    
   orfor i in range(1, 11):
    stringA = '%d'
    int(stringA)
    my_clause = 'COUNCILDISTRICT =' + stringA % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)
    

I also tried this:

for i in range(1, 11):
    my_clause = 'COUNCILDISTRICT = "%d"' % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)

But recieved this error message:

raceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 59, in arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,) File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 6997, in MakeFeatureLayer raise e arcgisscripting.ExecuteError: ERROR 000358: Invalid expression COUNCILDISTRICT = "1" Failed to execute (MakeFeatureLayer).

Shouldn't COUNCILDISTRICT = "1" work?

I have a heatmap script that will eventually print 10 PDF maps. At the moment it is failing at the SQL expression in the Make Feature Layer right before Kernel Density Raster creation because the column datatype is string. I'm having trouble changing it to an integer in the loop.

Traceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 58, in int(stringA) ValueError: invalid literal for int() with base 10: '%d'

Here is the part of the script that is failing:

arcpy.CheckOutExtension('Spatial')
#use 'CURRENT' if running from arcmap, when published use MXD on disk
mxd = arcpy.mapping.MapDocument(workspace+"\\working_environment.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0] # address location data frame and turn on select layers
df.zoomToSelectedFeatures()



arcpy.env.extent = df.extent #set extent to current one
arcpy.env.overwriteOutput = True #overwrite existing files

my_point_features = autoLayerGDB +"\\coded_xy_points_FIPS4203"
scratch_output = workspace+"scratch"
    

#Select each district via script
    
   or i in range(1, 11):
    stringA = '%d'
    int(stringA)
    my_clause = 'COUNCILDISTRICT =' + stringA % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)
    

I have a heatmap script that will eventually print 10 PDF maps. At the moment it is failing at the SQL expression in the Make Feature Layer right before Kernel Density Raster creation because the column datatype is string. I'm having trouble changing it to an integer in the loop.

Traceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 58, in int(stringA) ValueError: invalid literal for int() with base 10: '%d'

Here is the part of the script that is failing:

arcpy.CheckOutExtension('Spatial')
#use 'CURRENT' if running from arcmap, when published use MXD on disk
mxd = arcpy.mapping.MapDocument(workspace+"\\working_environment.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0] # address location data frame and turn on select layers
df.zoomToSelectedFeatures()



arcpy.env.extent = df.extent #set extent to current one
arcpy.env.overwriteOutput = True #overwrite existing files

my_point_features = autoLayerGDB +"\\coded_xy_points_FIPS4203"
scratch_output = workspace+"scratch"
    

#Select each district via script
    
   for i in range(1, 11):
    stringA = '%d'
    int(stringA)
    my_clause = 'COUNCILDISTRICT =' + stringA % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)
    

I also tried this:

for i in range(1, 11):
    my_clause = 'COUNCILDISTRICT = "%d"' % i
    my_filename = "kden_d%d" % i
    arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,)
    outKDens = KernelDensity("templyr", "None", cell_size=100)
    outKDens.save(autoLayerGDB+"\\"+my_filename)
    print("\tRaster created for District %d" % i)

But recieved this error message:

raceback (most recent call last): File "\coacd.org\dfs\SWS\Code Enforcement\ACD Admin Operations\GIS\Operations\Council District Analysis Reporting\Auto_HeatMap_WIP\test.py", line 59, in arcpy.MakeFeatureLayer_management(my_point_features, 'templyr', where_clause=my_clause,) File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 6997, in MakeFeatureLayer raise e arcgisscripting.ExecuteError: ERROR 000358: Invalid expression COUNCILDISTRICT = "1" Failed to execute (MakeFeatureLayer).

Shouldn't COUNCILDISTRICT = "1" work?

added 46 characters in body
Source Link
Loading
updated question, error, and script based on SQL integer/string issue
Source Link
Loading
Updated the question and summary of problem to highlight SQL error.
Source Link
Loading
Updated the error after making a few suggested edits.
Source Link
Loading
Trimmed code down to the problematic area
Source Link
Loading
Edited the description of the problem in the body
Source Link
Loading
deleted 339 characters in body
Source Link
Loading
Made edits based on suggestions. Still receiving error.
Source Link
Loading
deleted 23 characters in body
Source Link
Loading
naming
Link
Vince
  • 20.3k
  • 16
  • 48
  • 65
Loading
Source Link
Loading