ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

QueryRow

  • Summary
  • Discussion
  • Code sample

Summary

The QueryRow object provides access to all the values in a row from the result of the queryJobs method.

Discussion

The QueryRow object can be accessed from QueryResult by index, field name or iterator.

Code sample

QueryRow example

The following script runs a job query and accesses a query row.

import arcpy
import arcpywmx

# Establish a connection to a Workflow database
conn = arcpywmx.Connect(r'c:\test\Workflow.jtc')

# Run a query for jobs being assigned to current user. The query results are
# sorted by job name.
result = conn.queryJobs("JOB_NAME,ASSIGNED_TO", "JTX_JOBS",
                        "Job Name,Assigned To",
                        "ASSIGNED_TO = '[SYS:CUR_LOGIN]'", "JOB_NAME")

# To get total number of records being returned which are assigned to current user.
print("There are %s jobs assigned to me" % str(len(result.rows)))

# Access first row by index 
print("The first value is %s" % str(result.rows[0]))

# Access first row's job name field by field name
print("The job name is %s" % result.rows[0]['JOB_NAME'])

# Access first row's fields values by iterator
row = result.rows[0]
for val in row:
    print("Value is %s" % str(val))

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal