---
schema_version: "1"
id: e1abc02aa0526b8abcec2c5b84e3c8cbffb2e45fc903eb4b7ce00a620d9fe797
title: OVERLAY
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/scalar-func/string-func/overlay.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/overlay.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6b245192fdad96629a6118b3b0d6ab072c9321bbe5e8198739b9e1dd24f61b8b
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `OVERLAY`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Replaces a substring within a string at a specified position.

## Syntax

```sql
overlay(<string> placing <replacement> from <start> for <count>)
```

## Arguments

### Required

- `<string>`: The original string to modify.
- `<replacement>`: The substring to insert.
- `<start>`: The starting position (1-based).
- `<count>`: The number of characters to replace.

## Returns

Returns a text value with the specified substring replaced.

## Examples

### Replace Substring

Replace characters within a string.

```sql
SELECT overlay('Txxxas' placing 'hom' from 2 for 4) AS result;
```

Returns `'Thomas'` by replacing 4 characters starting at position 2 with 'hom'.

## Related Documentation

- [String Types](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/string.md)
