Skip to main content

While extracting data using an API, we got stuck at a point that in the extraction filter field no strings with a single quote can be inserted, such as:

 

filter = 'content_description eq '*purchase order*' '

 

It will return an error, see screenshot below. Is there an way to insert string values here with a single quote in it?

 

Things we tried:

  • Escaping the single quote characters using two single quotes (as in Vertica) or with a backslash, without success.
  • Wrapping this value in a variable. It looks as accepted in the first way, but will return in parsing error during te extraction (see screenshot below).

 

Thanks in advance!

Jan-peter

 

 

Screenshot 1: Filter Statement FieldError in extraction filter 

Screenshot 2: Error when text string is wrapped during the extraction:

single_quote_extraction_error 

Hello,

Based on the screenshot, it looks like we are in an Extraction Job, within the Data Job tab.
I'm assuming that the field we want to filter on is named content_description, and that we want to only extract records where content_description = '*purchase order*'. The single quotes and the asterisks are part of the string as you have it in your source database.
With these assumptions, the correct syntax for the Filter Statement box might be:
content_description = "'*purchase order*'"

I am not 100% sure if encapsulating the single quotes in double quotes will work, and if not, could you try your variable method with the syntax above?

Reply