MakeQueryLayer retrives some integers as 0

277
3
08-18-2022 01:30 PM
DiegoMonge_Chinchilla
New Contributor III

Hello everyone

I´m trying to do a MakeQueryLayer with ArcGIS PRO 3.0.1 and it works as expected.

The problem is when I tried to do it in ArcPy and I get Integer Columns as 0 instead of the real value.

I´m using a .sde file conected to a Oracle data base using the instant client 21.06

This is how I get the data using ArcGIS PRO interface (everything looks fine):

DiegoMonge_Chinchilla_0-1660853812007.png

 

This is how I get the data using Arcpy on the Notebook, ArcGIS PRO console or using the python.exe enviroment:

DiegoMonge_Chinchilla_1-1660854051425.png

This is my code:

 

 

conexion_oracle = '\conexion_oracle.sde'

query = "select ID_VISITA_TECNICA, CAST(ANIO AS INT) AS ANIO, IDENTIFICACION, PRODUCTOR, REGIONAL, CICLO, N, AREA_APLICADA, PESO_SACO, CANTIDAD_SACOS from CRCAFE.ICFSIG_VISITAS_FERTILIZANTES_VW"

arcpy.management.MakeQueryLayer(conexion_oracle, 'fertilizantes', query, 'ID_VISITA_TECNICA')

 

 

 

Any help will be appreciated.

Thanks

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

Are those two columns numbers expressed as text/string values? or are they just left justified?


... sort of retired...
0 Kudos
DiegoMonge_Chinchilla
New Contributor III

Hello Dan

Those colums are Integers

0 Kudos
DanPatterson
MVP Esteemed Contributor

strange... it is almost like the justification has interpreted it as non-integer... try changing the justification in the source columns first otherwise, Tech Support might be your best bet


... sort of retired...
0 Kudos