escape square brackets in Google Ads Query Language Grammar

46 views
Skip to first unread message

Artur

unread,
Mar 12, 2019, 3:19:39 PM3/12/19
to AdWords API and Google Ads API Forum
Hello,

how do I escape square brackets in the Google Ads Query Language Grammar. normally you would escape square brackets by writing "[[]" but this does not work in the Google Ads Query.

thank you and best regards
Artur

googleadsapi...@google.com

unread,
Mar 12, 2019, 11:39:13 PM3/12/19
to AdWords API and Google Ads API Forum
Hi Artur,

To better assist you, could you provide the complete query statement you are using? I tried to include square brackets ( [ ] ) in my query on my end and was able to generate reports successfully.

Refer to the query below:
SELECT campaign.id,campaign.name,campaign_budget.amount_micros FROM campaign WHERE campaign.name IN ('[campaign-with-brackets]')

Regards,
Dannison
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/ef5628ef-e2db-4dae-8f69-6d7e5c9ace58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Artur

unread,
Mar 13, 2019, 5:25:56 AM3/13/19
to AdWords API and Google Ads API Forum
Hello Dannison,

I am using LIKE operator to look for items that have a specific character pattern at the beginning (it includes square bracket characters). square brackets in LIKE operator are wildcard characters and to use them as a literal character I have to escape those.

e.g. 
normally this would work in SQL but it does not work in the Google Ads Query:
SELECT campaign.id,campaign.name FROM campaign WHERE campaign.name LIKE '[[]campaign-with-brackets]%'

thank you & best regards
Artur

Artur

unread,
Mar 19, 2019, 5:41:22 AM3/19/19
to AdWords API and Google Ads API Forum
is there a solution?

I am using JAVA btw
Reply all
Reply to author
Forward
0 new messages