type Statement (v202408)
Stay organized with collections
Save and categorize content based on your preferences.
Captures the WHERE
, ORDER BY
and LIMIT
clauses of a
PQL query. Statements are typically used to retrieve objects of a predefined
domain type, which makes SELECT clause unnecessary.
An example query text might be "WHERE status = 'ACTIVE' ORDER BY id
LIMIT 30"
.
Statements support bind variables. These are substitutes for literals
and can be thought of as input parameters to a PQL query.
An example of such a query might be "WHERE id = :idValue"
.
Statements also support use of the LIKE keyword. This provides wildcard string matching.
An example of such a query might be "WHERE name LIKE '%searchString%'"
.
The value for the variable idValue must then be set with an object of type
Value, e.g.,
NumberValue,
TextValue or
BooleanValue.
- Namespace
-
https://www.google.com/apis/ads/publisher/v202408
Field
|
query
|
xsd:string
Holds the query in PQL syntax. The syntax is:
[WHERE <condition> {[AND | OR] <condition>
...}]
[ORDER BY <property> [ASC | DESC]]
[LIMIT {[<offset>,] <count>} | {<count>
OFFSET <offset>}]
<condition>
:= <property> {< | <= | > | >= | = | != }
<value>
<condition>
:= <property> {< | <= | > | >= | = | != }
<bind variable>
<condition> := <property> IN
<list>
<condition> := <property> IS NULL
<condition> := <property> LIKE
<wildcard%match>
<bind variable> := :<name>
|
values
|
String_ValueMapEntry[]
Holds keys and values for bind variables and their values. The key is the
name of the bind variable. The value is the literal value of the variable.
In the example "WHERE status = :bindStatus ORDER BY id LIMIT 30" ,
the bind variable, represented by :bindStatus is named bindStatus , which would also be the parameter map key. The bind variable's
value would be represented by a parameter map value of type
TextValue. The final result, for example, would be an entry of
"bindStatus" => StringParam("ACTIVE") .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-06 UTC.
[null,null,["Last updated 2025-08-06 UTC."],[[["\u003cp\u003eStatement objects define the \u003ccode\u003eWHERE\u003c/code\u003e, \u003ccode\u003eORDER BY\u003c/code\u003e, and \u003ccode\u003eLIMIT\u003c/code\u003e clauses for PQL queries, retrieving objects of a specific type.\u003c/p\u003e\n"],["\u003cp\u003eThey utilize bind variables as placeholders for literal values, enhancing query flexibility and security.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003equery\u003c/code\u003e field contains the PQL syntax, while the \u003ccode\u003evalues\u003c/code\u003e field stores key-value pairs for bind variables and their corresponding values.\u003c/p\u003e\n"],["\u003cp\u003eWildcard string matching is supported through the \u003ccode\u003eLIKE\u003c/code\u003e keyword, enabling broader search capabilities.\u003c/p\u003e\n"],["\u003cp\u003eStatements provide a structured approach to data retrieval within the Google Ad Manager API.\u003c/p\u003e\n"]]],["The document outlines various services and their functionalities, including managing ads, audiences, content, creatives, and inventory. The `Statement` structure is detailed, it is used for querying data, supporting `WHERE`, `ORDER BY`, and `LIMIT` clauses, and using bind variables for dynamic queries. Bind variables act as placeholders for literals, with `values` field storing their names and corresponding values (e.g. TextValue, NumberValue) for use in constructing dynamic PQL (Publisher Query Language) queries.\n"],null,["# type Statement (v202408)\n\n**Service** \n[AdRuleService](/ad-manager/api/reference/v202408/AdRuleService.Statement) [AdjustmentService](/ad-manager/api/reference/v202408/AdjustmentService.Statement) [AudienceSegmentService](/ad-manager/api/reference/v202408/AudienceSegmentService.Statement) [CdnConfigurationService](/ad-manager/api/reference/v202408/CdnConfigurationService.Statement) [CmsMetadataService](/ad-manager/api/reference/v202408/CmsMetadataService.Statement) [CompanyService](/ad-manager/api/reference/v202408/CompanyService.Statement) [ContactService](/ad-manager/api/reference/v202408/ContactService.Statement) [ContentBundleService](/ad-manager/api/reference/v202408/ContentBundleService.Statement) [ContentService](/ad-manager/api/reference/v202408/ContentService.Statement) [CreativeService](/ad-manager/api/reference/v202408/CreativeService.Statement) [CreativeSetService](/ad-manager/api/reference/v202408/CreativeSetService.Statement) [CreativeTemplateService](/ad-manager/api/reference/v202408/CreativeTemplateService.Statement) [CreativeWrapperService](/ad-manager/api/reference/v202408/CreativeWrapperService.Statement) [CustomFieldService](/ad-manager/api/reference/v202408/CustomFieldService.Statement) [CustomTargetingService](/ad-manager/api/reference/v202408/CustomTargetingService.Statement) [DaiAuthenticationKeyService](/ad-manager/api/reference/v202408/DaiAuthenticationKeyService.Statement) [DaiEncodingProfileService](/ad-manager/api/reference/v202408/DaiEncodingProfileService.Statement) **InventoryService** [LabelService](/ad-manager/api/reference/v202408/LabelService.Statement) [LineItemCreativeAssociationService](/ad-manager/api/reference/v202408/LineItemCreativeAssociationService.Statement) [LineItemService](/ad-manager/api/reference/v202408/LineItemService.Statement) [LineItemTemplateService](/ad-manager/api/reference/v202408/LineItemTemplateService.Statement) [LiveStreamEventService](/ad-manager/api/reference/v202408/LiveStreamEventService.Statement) [MobileApplicationService](/ad-manager/api/reference/v202408/MobileApplicationService.Statement) [NativeStyleService](/ad-manager/api/reference/v202408/NativeStyleService.Statement) [OrderService](/ad-manager/api/reference/v202408/OrderService.Statement) [PlacementService](/ad-manager/api/reference/v202408/PlacementService.Statement) [ProposalLineItemService](/ad-manager/api/reference/v202408/ProposalLineItemService.Statement) [ProposalService](/ad-manager/api/reference/v202408/ProposalService.Statement) [PublisherQueryLanguageService](/ad-manager/api/reference/v202408/PublisherQueryLanguageService.Statement) [ReportService](/ad-manager/api/reference/v202408/ReportService.Statement) [SiteService](/ad-manager/api/reference/v202408/SiteService.Statement) [StreamActivityMonitorService](/ad-manager/api/reference/v202408/StreamActivityMonitorService.Statement) [SuggestedAdUnitService](/ad-manager/api/reference/v202408/SuggestedAdUnitService.Statement) [TargetingPresetService](/ad-manager/api/reference/v202408/TargetingPresetService.Statement) [TeamService](/ad-manager/api/reference/v202408/TeamService.Statement) [UserService](/ad-manager/api/reference/v202408/UserService.Statement) [UserTeamAssociationService](/ad-manager/api/reference/v202408/UserTeamAssociationService.Statement) [YieldGroupService](/ad-manager/api/reference/v202408/YieldGroupService.Statement) **Dependencies** \n[getAdUnitSizesByStatement()](/ad-manager/api/reference/v202408/InventoryService#getAdUnitSizesByStatement) [getAdUnitsByStatement()](/ad-manager/api/reference/v202408/InventoryService#getAdUnitsByStatement) [performAdUnitAction()](/ad-manager/api/reference/v202408/InventoryService#performAdUnitAction) \n▼\n**Statement**\n\nCaptures the `WHERE`, `ORDER BY` and `LIMIT` clauses of a\nPQL query. Statements are typically used to retrieve objects of a predefined\ndomain type, which makes SELECT clause unnecessary.\n\n\nAn example query text might be `\"WHERE status = 'ACTIVE' ORDER BY id\nLIMIT 30\"`.\n\n\nStatements support bind variables. These are substitutes for literals\nand can be thought of as input parameters to a PQL query.\n\n\nAn example of such a query might be `\"WHERE id = :idValue\"`.\n\n\nStatements also support use of the LIKE keyword. This provides wildcard string matching.\n\n\nAn example of such a query might be `\"WHERE name LIKE '%searchString%'\"`.\nThe value for the variable idValue must then be set with an object of type [Value](/ad-manager/api/reference/v202408/InventoryService.Value), e.g., [NumberValue](/ad-manager/api/reference/v202408/InventoryService.NumberValue), [TextValue](/ad-manager/api/reference/v202408/InventoryService.TextValue) or [BooleanValue](/ad-manager/api/reference/v202408/InventoryService.BooleanValue).\n\n*** ** * ** ***\n\nNamespace\n:\n `https://www.google.com/apis/ads/publisher/v202408`\n\n| Field ----- ||\n|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ### `query` | ` `xsd:`string` Holds the query in PQL syntax. The syntax is: `[WHERE \u003ccondition\u003e {[AND | OR] \u003ccondition\u003e ...}]` `[ORDER BY \u003cproperty\u003e [ASC | DESC]]` `[LIMIT {[\u003coffset\u003e,] \u003ccount\u003e} | {\u003ccount\u003e OFFSET \u003coffset\u003e}]` `\u003ccondition\u003e` `:= \u003cproperty\u003e {\u003c | \u003c= | \u003e | \u003e= | = | != } \u003cvalue\u003e` `\u003ccondition\u003e` `:= \u003cproperty\u003e {\u003c | \u003c= | \u003e | \u003e= | = | != } \u003cbind variable\u003e` `\u003ccondition\u003e := \u003cproperty\u003e IN \u003clist\u003e` `\u003ccondition\u003e := \u003cproperty\u003e IS NULL` `\u003ccondition\u003e := \u003cproperty\u003e LIKE \u003cwildcard%match\u003e` `\u003cbind variable\u003e := :\u003cname\u003e` \u003cbr /\u003e |\n| ### `values` | ` `[String_ValueMapEntry](/ad-manager/api/reference/v202408/InventoryService.String_ValueMapEntry)`[]` Holds keys and values for bind variables and their values. The key is the name of the bind variable. The value is the literal value of the variable. In the example `\"WHERE status = :bindStatus ORDER BY id LIMIT 30\"`, the bind variable, represented by `:bindStatus` is named `bindStatus`, which would also be the parameter map key. The bind variable's value would be represented by a parameter map value of type [TextValue](/ad-manager/api/reference/v202408/InventoryService.TextValue). The final result, for example, would be an entry of `\"bindStatus\" =\u003e StringParam(\"ACTIVE\")`. \u003cbr /\u003e |"]]