쿼리 실행

쿼리를 실행하려면 queries.run 요청을 queryId 및 실행 세부정보 이 요청은 Report 리소스를 실행합니다.

쿼리를 실행하고 결과로 반환되는 보고서 리소스 ID를 가져오는 방법은 다음과 같습니다.

자바

// ID of query to run.
Long queryId = query-id;

// Run the query.
Report report = service.queries().run(queryId, null).execute();

// Print the running report ID.
System.out.printf(
    "Report %s generated and running.%n",
    report.getKey().getReportId());

Python

# The ID of the existing query.
query_id = query-id

# Run the query.
running_report = (
  service.queries().run(queryId=query_id).execute()
)

# Print running report ID.
print(f'Report {running_report["key"]["reportId"]} generated and running.')

PHP

// ID of the query to run.
$queryId = query-id;

// Run the query.
$report = $this->service->queries->run(
    $queryId,
    new Google_Service_DoubleClickBidManager_RunQueryRequest(),
    array());

// Print the running report ID
printf(
    'Report %s generated and running.<br>',
    $report->getKey()->getReportId());