"Make Query Layer" issue between ArcMap and Pro.

350
2
06-13-2019 05:43 AM
by Anonymous User
Not applicable

If I run the following query in python 2.7  it allows me to use OBJECTID as the unique ID field but in python 3 it does not. Does anyone know why or how to get it to work?

SELECT (ROW_NUMBER() OVER(ORDER BY ARN)) as OBJECTID, ARN, MOD_DATE, Shape FROM dbo.vw_GC_ARN
‍

full code I was using:

arcpy.MakeQueryLayer_management(
 lro16, "parcels", """SELECT (ROW_NUMBER() OVER(ORDER BY ARN)) as OBJECTID, ARN, MOD_DATE, Shape FROM dbo.vw_GC_ARN""", "OBJECTID", "POLYGON", srid="5320")‍‍
0 Kudos
2 Replies
ChristianWells
Esri Regular Contributor

This could be how the GP tool is interpreting the column (Long vs Short integer) upon creation and may be a bug. If you run the GP tool manually in Pro, do you experience the same issue?

0 Kudos
by Anonymous User
Not applicable

If I run the tool in Pro it doesn't allow me to continue without selecting ARN or MOD_DATE before continuing. I tried typing in OBJECTID and it gives an error