QueryField

サマリー

The QueryField object exposes properties detailing a field returned by the queryJobs method.

説明

The QueryField object of a certain QueryResult row can be accessed by index or iterator.

プロパティ

プロパティ説明データ タイプ
name
(読み取り専用)

The field name returned from job query.

String
alias
(読み取り専用)

The field alias returned from job query.

String

コードのサンプル

QueryField example

The following script runs a job query and accesses the query field.

import arcpy

#Establish a connection to a Workflow database
conn = arcpy.wmx.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 field by index
print ("The first field is named %s" % result.fields[0].name)


# Access each field by iterator
for f in result.fields:
    print("Field is %s" % f.name)