Where empty string or Null

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Cloud Applications
Post Reply
ccampbell
Posts: 31
Joined: Tue 01 Jun 2010 17:31
Location: Oregon

Where empty string or Null

Post by ccampbell » Mon 29 Jun 2020 15:36

Hello. Using Devart.Data.Salesforce 3.5.980.0 in VS 2017.

I’m attempting to run a query on the Salesforce Campaign object. I’m wanting to return all rows where the ParentID field (Reference Field) is blank, null, empty, whatever.

I’ve tried:

Code: Select all

 Campaign.ParentID= ‘’ 
and also tried

Code: Select all

Campaign.ParentID= Null
and also tried

Code: Select all

 (Campaign.ParentID= ‘’ OR Campaign.ParentID= Null)


Both methods return no rows, even though rows exist where the ParentID is blank. What other options can I try?

Thanks.

Chris

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Where empty string or Null

Post by Shalex » Tue 07 Jul 2020 12:20

Please try:

Code: Select all

cmd.CommandText = "SELECT Id FROM Campaign WHERE ParentID IS NULL";
= / != evaluate for values, IS NULL / IS NOT NULL are used to check for NULLs.

ccampbell
Posts: 31
Joined: Tue 01 Jun 2010 17:31
Location: Oregon

Re: Where empty string or Null

Post by ccampbell » Thu 09 Jul 2020 15:21

I think I tried that as well and received an soql error. I'll give it another shot though. Thanks.

Post Reply