You are viewing limited content. For full access, please sign in.

Question

Question

Does the Query Data workflow activity automatically escape single quote characters?

asked on February 8, 2023 Show version history

I am using the Query Data activity to select values from a SQL server db.

It has been working fine but returns nothing when querying for the test value "Bachelor's".

This is the only value in the queried table that has a single quote so i am thinking that if it is not being escaped, this might be the cause for returning false for the resultsfound token.

The query data activity uses a token value to search and not a literal.

When I test the query manually with a literal, it does return true for results found.

I tried formatting the token value used for the query with the token function EscapeSearchPhrase but this only affects double quotes, not single quotes.

I'd appreciate any info or suggestions for this scenario. Thanks!

 

Workflow version 10.4.0.131

0 0

Replies

replied on February 8, 2023

How are you connecting to the database?  Is it via ODBC or another method?  Because I do not believe I experience this issue on Workflow 11 with ODBC connection to the SQL Server.

Also, double check that your token and database values are both the same type of quote character.  Depending on where the data came from, if it's replaced it with a smart apostophe ( ’ ) then it won't match to a normal apostophe ( ' ).

0 0
replied on February 9, 2023

Thanks for responding Matthew.

The setup for the connection to the database is:

  • Wizard type: Direct connections
  • Data source type: ODBC
  • Data source driver: SQL

 

The token and db values are the same because the token gets its value from the same table through a view.

1. A metadata field value is assigned to an entry via the view.

2. Then in this workflow that I am working on, the same table is queried using that entry's field value ("Bachelor's").

0 0
replied on February 9, 2023

Darn.  In that case, I'm out of ideas.  Seems to me like it should be working, and I'm not certain why it wouldn't be.

There are a lot of awesome smart people on this forum, hopefully one of them knows what is happening here.

0 0
replied on February 10, 2023

What is the data type of this column?

1 0
replied on February 10, 2023

The data type for the column with "Bachelor's" is varchar(MAX).

 

Also forgot to mention that I am using Workflow 10.4.0.131 in case that matters.

0 0
replied on February 10, 2023

If you switch Data Source Type to Direct does anything change?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.