# SET OPTIONS

Use the `SET OPTIONS` clause to configure query behavior.

## Syntax

```nolang
[SET OPTIONS (optionName = optionValue [, optionName = optionValue])]
```

## Example

```nolang
SELECT Id, Name
FROM MyDLO__dlm
WHERE Status__c = 'Active'
SET OPTIONS (dataspace = 'default', honorEmptyStrings = true)
```

## `dataspace` Option

Use `dataspace` to specify which dataspace to query when querying a DLO. If the `dataspace` isn’t specified, the query returns zero records. Valid only for DLO queries, not supported for data model object (DMO) queries.

| Option      | Values                       |
| ----------- | ---------------------------- |
| `dataspace` | `'<dataspaceName>'` (string) |

**Example**

```nolang
SELECT AccountId__c, Email__c
FROM CustomerProfile__dlm
SET OPTIONS (dataspace = 'default')
```

## `honorEmptyStrings` Option

Salesforce Platform objects don’t distinguish between `NULL` and an empty string (`''`). A SOQL query filtering on either value returns the same records. Data 360 DLOs treat `NULL` and empty string as different values. Use `honorEmptyStrings` to control how filtering behaves when querying DLOs.

The `honorEmptyStrings` option also supports simple queries for DMOs.

| Option              | Values            | Behavior                                                                                                                                           |
| ------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `honorEmptyStrings` | `true`            | `NULL` and empty string are treated as different values. Filtering returns different record sets depending on whether the value is `NULL` or `''`. |
| `honorEmptyStrings` | `false` (default) | `NULL` and empty string are treated as the same value. Consistent with querying Salesforce Platform objects.                                       |

**Examples**

This query returns records where `EmailOptIn__c` is either `NULL` or `''`.

```nolang
SELECT Id, EmailOptIn__c
FROM ContactDLO__dlm
WHERE EmailOptIn__c = ''
SET OPTIONS (dataspace = 'default', honorEmptyStrings = false)
```

This query returns only records where `EmailOptIn__c` is an empty string.

```nolang
SELECT Id, EmailOptIn__c
FROM ContactDLO__dlm
WHERE EmailOptIn__c = ''
SET OPTIONS (dataspace = 'default', honorEmptyStrings = true)
```

## `explicitNamespace` Option

Use `explicitNamespace` to enable explicit namespace resolution for a dynamic SOQL query. This option is applicable to only managed Apex, and you must pass the option as a bind variable. See [Prevent Field Name Collisions in Managed SOQL Queries](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_manpkgs_dynamic_soql.htm) in the *Apex Developer Guide*.
