AnsweredAssumed Answered

Auto populate field data in one table using the reference of other table

Question asked by yoga190891 on May 14, 2019
Latest reply on May 19, 2019 by bixb0012

I need to auto populate field data in one table using the reference of other table.  I tried this using some sql scripting in arcpy. using the script I was able to pull the data from table but not modifying of the data.

 

import arcpy
# Use a connection file to create the connection
egdb = r'C:\Users\mlgsadmin\AppData\Roaming\ESRI\Desktop10.6\ArcCatalog\Connection to 10.72.15.186.sde'
egdb_conn = arcpy.ArcSDESQLExecute(egdb)
table_name = 'SDE.BPPL_Overall_Status'
field_name = 'Status'
sql = '''
UPDATE SDE.BPPL_Overall_Status
SET BPPL_Overall_Status.Clearing = Cleraing_ROW_0_175_Km.STATUS
from BPPL_Overall_Status
Inner Join Cleraing_ROW_0_175_Km
ON BPPL_Overall_Status.Start_mts=Cleraing_ROW_0_175_Km.Start_mts
'''
.format(field_name, table_name)
egdb_return = egdb_conn.execute(sql)

 

This was the script used.

Outcomes