Toad World® Forums

Query builder where clause IN operator with empty string

I’m using query builder in TDP 3.6 and I am trying to use the IN operator in the WHERE clause. I am trying to select ‘’ (empty string), ‘QUAL’, ‘UNAV’, etc. but for the empty string it just puts in a comma. When I run the query it returns the error Incorrect syntax near ‘,’.

query_builder_empty_string_tdp36.png

Is this a bug, or is there some other way to choose an empty string?

Andy since the Query Builder builds the query for you if you want to utilize an empty string or characters you need to include the double quotes around the quote marks for the empty string and for each set of characters quotes to identify them as text so your query would look like “’ '”,‘QUAL’,‘UNAV’ when you enter it in the grid which would produce the statement IN (’ ‘, ‘QUAL’, ‘UNAV’’’)) in the query statement tab. Hope this helps.

Thanks so much! Worked perfectly.